sum cell all sheets with condition

spilner

Board Regular
Joined
Jun 7, 2011
Messages
146
okay,i want to sum all sheets with a condition.

example :
its all in the same cell example A1

sheet 1 = 50 , sheet 2 = 100 , sheet 3 = 1000 , sheet 4 = 30

if its more than 50 sum it.if its below than 50 then 0.

my formula is like this but it aint work.im not very good in excel.

=SUMIF('1:4'!A11,min(50,a11),0)

i dont know how to write this,hope someone can help me.thanks a lot guys
 
ur correct marcelo

Sheet1 , A1=50
Sheet2 , A1=100
Sheet3 , A1=1000
Sheet4 , A1=30

Total : 1150

hope aladin can fix it.thanks

You have sheets name Sheet1, Sheet2, Sheet3, and Sheet4.
Enter in A1:A4 these sheet names say on a Summary sheet.
Select A1:A4 on the Summary sheet, name this range SheetList via the Name Box on the Formula Bar.

In E1 on the Summary sheet enter 50, your criterion value.

In F1 on the Summary sheet, enter the following formula:

=SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!A1"),">"&E1))
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You have sheets name Sheet1, Sheet2, Sheet3, and Sheet4.
Enter in A1:A4 these sheet names say on a Summary sheet.
Select A1:A4 on the Summary sheet, name this range SheetList via the Name Box on the Formula Bar.

In E1 on the Summary sheet enter 50, your criterion value.

In F1 on the Summary sheet, enter the following formula:

=SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!A1"),">"&E1))

Aladin,

I think it should be ">="&E1

See the expected result = 1150

M.
 
Upvote 0
This will work but is extremely tedious to enter as the number of sheets will grow:
Code:
=SUM((Sheet1!A1>=50)*Sheet1!A1,(Sheet2!A1>=50)*Sheet2!A1,(Sheet3!A1>=50)*Sheet3!A1,(Sheet4!A1>=50)*Sheet4!A1)
 
Upvote 0
@aladin

i dont understand in this part.sorry aladin.

Enter in A1:A4 these sheet names say on a Summary sheet.
Select A1:A4 on the Summary sheet, name this range SheetList via the Name Box on the Formula Bar.
 
Upvote 0
@aladin

i dont understand in this part.sorry aladin.

Enter in A1:A4 these sheet names say on a Summary sheet.
Select A1:A4 on the Summary sheet, name this range SheetList via the Name Box on the Formula Bar.

Which sheet do you want to have the formula?
 
Upvote 0
@aladin

i dont understand in this part.sorry aladin.

Enter in A1:A4 these sheet names say on a Summary sheet.
Select A1:A4 on the Summary sheet, name this range SheetList via the Name Box on the Formula Bar.

I'll try to repeat Aladin's instructions, step by step

1.Create a new sheet and name it Summary

In this new sheet
2.type respectively in A1, A2, A3, A4
Sheet1
Sheet2
Sheet3
Sheet4

Go to Name box (beside the Formula Bar) and type in
SheetList
hit ENTER

3. Still in the Summary sheet
in E1 type 50
in F1 enter this formula
=SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!A1"),">="&E1))

done!

M.
 
Upvote 0
To implement the formula above maybe we can use VBA. Paste this VBA code in standard VBA module.
Step 1) Select cell where you need formula
Step 2) Run this code which will ask you for cell address (A1 in above case). Provide it.
Step 3) the formula will be inserted in the selected cell.
Code:
Public Sub BuildMyFormula()
Dim sFormula As String
'Provide the cell address in format like A1, B1 etc
CellName = InputBox("Please provide cell address like A1", "Cell Address")
sFormula = ""
'This builds up the formula on its own
For i = 1 To Sheets.Count
sFormula = sFormula & "(" & Sheets(i).Name & "!" & CellName & ">=50)" & "*" & _
Sheets(i).Name & "!" & CellName & ","
Next i
'Removes unnecessary comma
sFormula = Left(sFormula, Len(sFormula) - 1)
'Sets the formula in active cell
ActiveCell.Formula = "=SUM(" & sFormula & ")"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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