Sum across worksheets multiple criterias

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
Hi everyone I really need some help.

I'm trying to get this formula below to work across multiple worksheets.

=SUM(IF(RIGHT(C3:C15,5)<>"Total",IF(D1:G1="Bonus",IF(ISNUMBER(D3:G15),D3:G15))))


So what I did I tried to modified into this?

Code:
=SUM(IF(RIGHT(OFFSET(INDIRECT("'"&C2:D2&"'!C3:C15")
,ROW(INDIRECT("3:15"))-3,0,1)),5)<>"Total",
IF(N(OFFSET(INDIRECT("'"&C2:D2&"'!D1:G1"),
ROW(INDIRECT("3:15"))-3,0,1))="Bonus",
ISNUMBER(N(OFFSET(INDIRECT("'"&C2:D2&"'!D3:G15"),
ROW(INDIRECT("3:15"))-3,0,1))),
N(OFFSET(INDIRECT("'"&C2:D2&"'!D3:G15"),ROW(INDIRECT("3:15"))-3,0,1))))


But it gives me a value error.

I can't use any Add-ins or vba for this. Hopefully we could get this formula to work above.


Here is an small example I Have, If you have notice the word bonus appears in 2 different columns.
Sum Across Worksheets.xls
ABCDEFG
1HoursDownBonus
2DateSHClockWorkedTimeHours
3105062224330-1.20
410506222435.250.48-0.18
510506222438.251-0.17
610506222431.20.20.29
743 Total3.5-1.26
8
910506222443.180.83-2.33
1044 Total8.51-2.33
11
1210506222450.3710.23
1310506222452.6201.69
1410506222451.550.484.01
1545 Total2.875.94
16
Sheet2
Sum Across Worksheets.xls
ABCDEF
1DownBonus
2DateSHClockTimeHours
310506221211.430.43
410506221211.100.45
510506221211.49-0.11
621 Total0.77
7
810506221276.302.60
910506221270.670.19
1010506221271.940.42
1110506221272.750.75
1227 Total3.97
13
Sheet3
 
Hi Domenic,


The formula works fantastic.

But the only thing is that some of the worksheets has the #DIV/0! errors. Can we ignore those type of errors. Maybe with the ISNUMBER Function?
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I figured it out.


=SUM(IF(ArrayA,IF(ISNUMBER(ArrayA),IF(ISNUMBER(ArrayB),ArrayB))))


Thank You so much for this solution. This really going to save me time when I go back to work on Monday.

Thank You!
 
Upvote 0
I figured it out.


=SUM(IF(ArrayA,IF(ISNUMBER(ArrayA),IF(ISNUMBER(ArrayB),ArrayB))))

Good show! Although, it doesn't look like ArrayA (Column C) should contain any errors. As far as I can see it contains the clock number and no division takes place. If this is the case, then the following should suffice...

=SUM(IF(ArrayA,IF(ISNUMBER(ArrayB),ArrayB)))

Thank You so much for this solution. This really going to save me time when I go back to work on Monday.

Thank You!

You're very welcome! Glad I could help!

Cheers!
 
Upvote 0
Hi Domenic,


Is there a way we could modify this define name range formula below? Right now when I create my weekly and monthly reports I need to change the column ranges manually in the formula below and it's various at times ranges from C thru U or D thru AA and so forth. Also there is that 29 limit could be use in that formula. There are some workbooks I need a range from C thru AG. If this could be done that will be great.


=CHOOSE(Pos,"D3:D15","E3:E15","F3:F15","G3:G15")
 
Upvote 0
Hi Fin,

Now that I've had another look at this, here's what I should have given you in the first place...

1) Delete 'Col', since you're not going to need it.

2) Change the reference for 'Pos' to the following...

Code:
=TRANSPOSE(MMULT((T(OFFSET(INDIRECT("'"&TRANSPOSE(Sheet1!$C$2:$D$2)&"'!C1:AG1"),,COLUMN(INDIRECT("C:AG"))-3,,1))="Bonus")*(COLUMN(INDIRECT("C:AG"))-3),TRANSPOSE(COLUMN(INDIRECT("C:AG"))^0)))

3) Change the reference for ArrayB to the following...

Code:
=N(OFFSET(INDIRECT("'"&Sheet1!$C$2:$D$2&"'!C3:C15"),ROW(INDIRECT("3:15"))-3,Pos,1))

I'm assuming that you have or will change the column reference C3:C15 for ArrayA, accordingly.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,392
Members
449,445
Latest member
JJFabEngineering

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top