Don't calculate range if the word NO is present in a different cell

richiwatts

Board Regular
Joined
Aug 27, 2002
Messages
131
I have this calculation

=SUM(E21:E68,G21:G68,I21:I68)

Is it possible to exclude any of the columns from the calculation is No is present?

If E20 says No the my calculation would be =SUM(G21:G68,I21:I68)
If G20 says No the my calculation would be =SUM(E21:E68,I21:I68)

If E20 and G20 says No the my calculation would be =SUM(I21:I68)

..and so on

Rich
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Im sure there is a more complex way to do this, but if you only have 3 columns, why not break them apart with something like this...
=if(E20="No",0,SUM(E21:E68))+if(G20="No",0,SUM(G21:G68))+if(I20="no,0,sum(I21:I68))

How many columns do you have anyway?
 
Last edited:
Upvote 0
Probably a better way, but:

Code:
=SUM(IF(E20<>"No",E21:E68,0))+SUM(IF(G20<>"No",G21:G68),0)+SUM(IF(I20<>"No",I21:I68,0))
 
Upvote 0
Thank you both!!!!!! Ahoy's worked. Don't need a better way when I get the results I had hoped for.

Rich
 
Upvote 0
You're welcome. Ford's formula should also work, he just left off a double quote at the end of the last "no".
Code:
=IF(E20="No",0,SUM(E21:E68))+IF(G20="No",0,SUM(G21:G68))+IF(I20=[COLOR=#ff0000]"no"[/COLOR],0,SUM(I21:I68))

Thanks for the feedback.
 
Upvote 0
You're welcome. Ford's formula should also work, he just left off a double quote at the end of the last "no".
Code:
=IF(E20="No",0,SUM(E21:E68))+IF(G20="No",0,SUM(G21:G68))+IF(I20=[COLOR=#ff0000]"no"[/COLOR],0,SUM(I21:I68))

Thanks for the feedback.
Thanks for the assist :)
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,417
Members
448,895
Latest member
omarahmed1

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