Nested IF?

Qazxswe

New Member
Joined
May 28, 2012
Messages
36
I have a series of prices as; D4 = Item A, D5 = Item B D6 = Item C

I have a IF statement in J15 which reads =IF(H15="YES",$D$4+D$6$,0) so adding Item A + Item C

In I15, if this contains a "Yes", I want the above statement in J15 to add together all three items (so D4+D5+D6)

What is the best way to do this? I am trying to do a nested IF but it stops after the initial statement so just adding items A + C
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
If that is as far as the problem goes, then try =IF(H15="YES",$D$4+D$6$,IF(I15="Yes",SUM($D$4:$D$6),0))

If this is going to keep expanding with more and more items / prices, then you would need to look at alternatives to IF, which might mean redesigning your sheet.
 
Upvote 0
Thanks for quick response - yes that is as far as the problem goes but Excel saying there is an error with above formula? Sorry can't see where it is...
 
Upvote 0
There is an error, I didn't notice your typo when I copied the short formula from your post. Check the position of the $ signs in red compared to the previous posts.

=IF(H15="YES",$D$4+$D$6,IF(I15="Yes",SUM($D$4:$D$6),0))
 
Upvote 0
Sorry - my bad and thanks again

It's not quite working still I'm afraid.

H15 = Yes & I15 = <blank> Result: Item A + C = Correct

H15 = Yes & I15 = Yes Result: same as above value = Incorrect

H15 = <blank> & I15 = Yes Result: A + B + C =Correct

Sorry if I wasn't clear' H15 will usually be "yes" = adding "yes" to I15 should add the item 2 increment

Makes sense?
 
Upvote 0
Edit - solved another way. Sum the A + C price and used a single IF to total up dependant if the Item B cell was a "yes"

Thanks again!
 
Upvote 0
H15 = Yes & I15 = Yes Result: same as above value = Incorrect
Are you saying that the formula result is the same as above, or that it should be the same as above?
 
Upvote 0
Edit - solved another way. Sum the A + C price and used a single IF to total up dependant if the Item B cell was a "yes"
That was one of my thoughts, but I dismissed it as your original post implied a zero result if neither had "Yes"
 
Upvote 0
That was one of my thoughts, but I dismissed it as your original post implied a zero result if neither had "Yes"

Which is was my expectation and the problem I just hit when thinking I had worked it out!

are you saying that the formula result is the same as above, or that it should be the same as above?

Yes = the it results in the value of Item A + C with no increase for B
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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