izabela92

New Member
Joined
Jul 10, 2017
Messages
5
Hello,

I am trying to write an IF function with two conditions, SUM(C2+D2+E2+G2)>0 and SUM(B2+F2+H2+I2+J2+K2+L2)=0. So only if certain fields are filled in and others are 0 I want it to return a value.

I have this so far but it does not seem to work properly =IF(AND(SUM(C2+D2+E2+G2)>0), (SUM(B2+F2+H2+I2+J2+K2+L2)=0), "BAD") . Can anyone help with this? Not sure what I am doing wrong.

Thanks!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
izabela92, Good afternoon.

Try to use:

=IF(AND(SUM(C2+D2+E2+G2)>0, SUM(B2+F2+H2+I2+J2+K2+L2)=0), "BAD", "Other")

I think it's just a question with the parentheses in the formula.

I hope it helps.
 
Upvote 0
By the way you can include the ranges in the SUM function instead of listing all the individual cells:

=IF(AND(SUM(C2:E2,G2)>0, SUM(B2,F2,H2:L2)=0), "BAD", "Other")
 
Upvote 0
Scott Huish, Good afternoon.

Solution much more elegant than my suggestion.

Have a nice day.

Greetings from Brazil.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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