sum of column across all sheets

Hashmeer1

New Member
Joined
Mar 3, 2017
Messages
2
i'm trying to pull a sum of each column from all 13 sheets onto a summary sheet using a combination of sum and vlookup.

f(x): =SUM(VLOOKUP($A3,'Jan 16'!$A:B,2,0))+(VLOOKUP($A3,'Feb 16'!$A:B,2,0))+(VLOOKUP($A3,'Mar 16'!$A:B,2,0))+(VLOOKUP($A3,'Apr 16'!$A:B,2,0))+(VLOOKUP($A3,'May 16'!$A:B,2,0))+(VLOOKUP($A3,'Jun 16'!$A:B,2,0))+(VLOOKUP($A3,'Jul 16'!$A:B,2,0))+(VLOOKUP($A3,'Aug 16'!$A:B,2,0))+(VLOOKUP($A3,'Sep 16'!$A:B,2,0))+(VLOOKUP($A3,'Oct 16'!$A:B,2,0))+(VLOOKUP($A3,'Nov 16'!$A:B,2,0))+(VLOOKUP($A3,'Dec 16'!$A:B,2,0))+(VLOOKUP($A3,'Jan 17'!$A:B,2,0))

however my lookup value isn't available on all sheets, easier said: the text value in column a may only exist on 1 to 12 of the 13 sheets, which returns with #N/A since i'm trying to return a sum value of all 13 sheets.

i feel like i'm going about this in a very caveman fashion but someone once told me don't be afraid to be a beginner. any help you can provide would be greatly appreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
If you want a sum of all values in all sheets.
Try using this Vba script.

Code:
Sub Sum_All_Sheets()
Application.ScreenUpdating = False
Dim ans As Long
Dim c As Range
ans = 0
    
    For i = 1 To Sheets.Count
    
    For Each c In Sheets(i).UsedRange
        If IsNumeric(c.Value) = True Then ans = c.Value + ans
    Next
Next
MsgBox "Total sum all sheets  " & ans
Application.ScreenUpdating = True
End Sub
 
Upvote 0
...but someone once told me don't be afraid to be a beginner...

...or ask for help. :) First, list your sheet names in a range of cells, let say G2:G14, then try...

Code:
=SUMPRODUCT(SUMIF(INDIRECT("'"&$G$2:$G$14&"'!A:A"),$A3,INDIRECT("'"&$G$2:$G$14&"'!B:B")))

Actually, it looks like you want the sum range to be a relative reference...

Code:
=SUMPRODUCT(SUMIF(INDIRECT("'"&$G$2:$G$14&"'!A:A"),$A3,INDIRECT("'"&$G$2:$G$14&"'!"&CELL("address",B:B))))

Hope this helps!
 
Upvote 0
you're the man domenic, it took me a minute to figure out your advise but that first code it killed it. wish i would've asked on here a long time ago rather than spending hours on youtube
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,722
Members
449,465
Latest member
TAKLAM

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