I've searched all over the forum and can't find a topic that matches what I'm trying to do. I apologize if this has been covered elsewhere.

I have a Calc file with one sheet for each week of the year. Each of these 52 sheets contains sales data for several thousand items. For simplicity's sake, I'll focus on the two relevant columns: column A contains an item number, and column B contains that item's sales totals for the week.

I also have an Annual Totals sheet, on which Column A contains every unique item number that occurs on any of the 52 weekly sheets, and I want Column B to add up all sales totals for that item number from the weekly sheets.

This would be easy if every sheet contained the same items, as I could use a formula like SUM(Wk1.B2:Wk52.B2). But my challenge is that not every item is sold every week. I import the weekly data from a report that only lists items with sales, so I can't have each week's sheet set up exatly the same, which would allow me to use that type of SUM formula.

I'm trying to figure out if a similar formula can be done using SUMIF (or some other function). Basically, I want a formula in Column B on my Totals sheet that will look for the value in column A and add up the totals from Column B on all 52 weekly sheets for each occurrence of that value. I know I could accomplish this goal with something like:

=SUMIF(Wk1.A2:A5000;A2;Wk1.B2:B500)+SUMIF(Wk2.A2:A5000;A2;Wk2.B2:B500)...+SUMIF(Wk52.A2:A5000;A2;Wk52.B2:B500)

But I really don't want to type out that whole formula, and it's probably over the character limit for a formula anyway.

The only other option I can think of right now is to combine all of my weekly data into one sheet and then use a SUMIF to pull the totals from that sheet. But I need to keep a separate sheet for each week, so I don't want to combine all of that detail into one sheet if it's not necessary.

Thanks in advance for any advice!