Multiple Worksheets

G

Guest

I have 13 worksheets, one for every month plus a total worksheet. I am
looking for a simple way to sum different cells depending on the result in
another cell. For example on the 12 monthly worksheets they all have the
same columns. Number of sales, cost of sales, budget and so on. What I
want to do is look at each worksheet and check the Number of sales and only
accumulate the amounts in the budget cell only if Number of sales is greater
than zero and place that number in a cell on the total worksheet. I
appreciate any help.
 
P

Peo Sjoblom

One way

=SUMPRODUCT(SUMIF(INDIRECT("'"&G1:G11&"'!A2"),">0",INDIRECT("'"&G1:G11&"'!B2")))

where G1:G11 holds each name of the sheets, or hard coded maybe

=SUMPRODUCT(SUMIF(INDIRECT("'"&{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov"}&"'!A2"),">0",INDIRECT("'"&{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov"}&"'!B2")))


A2 is the cell you want to check and B2 the one you want to sum, both can be
changed into ranges

--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com
 
G

Guest

Thanks, I will give that a try.

Peo Sjoblom said:
One way

=SUMPRODUCT(SUMIF(INDIRECT("'"&G1:G11&"'!A2"),">0",INDIRECT("'"&G1:G11&"'!B2")))

where G1:G11 holds each name of the sheets, or hard coded maybe

=SUMPRODUCT(SUMIF(INDIRECT("'"&{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov"}&"'!A2"),">0",INDIRECT("'"&{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov"}&"'!B2")))


A2 is the cell you want to check and B2 the one you want to sum, both can be
changed into ranges

--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com
 
G

Guest

I am having a little trouble getting this to work. I created each worksheet
and placed the formula in the cell and it gives me a #REF error. I hard
coded the worksheets into the formula with the same results
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top