If/then question

Gettingbetter15

New Member
Joined
Oct 20, 2016
Messages
20
Good morning!
I'm so grateful this website is here! I hope someone out there can help me. Based on the table below, I want to create an if/then statement in the cell to the right of the Total cell subtracting all Orange values from Apple values. I know this can be done, just don't know how. Can someone help me please? I can't wait to hear from you and thank you so very much!

AB
Apples25
Oranges16
Apples113
Oranges29
Total

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
=SUMIF(A2:A5,"Apples",B2:B5)

just add the apples values
 
Upvote 0
Give this a try...

=SUMIF(A1:A4,"Apples",B1:B4)-SUMIF(A1:A4,"Oranges",B1:B4)
 
Upvote 0
Awesome! Thank you both for your help! I appreciate it so much! I'm going with Mr. Rothstein's response bc it provides the difference between both, which is what I was looking for! Have a great rest of your week!
 
Upvote 0

Forum statistics

Threads
1,215,132
Messages
6,123,227
Members
449,091
Latest member
jeremy_bp001

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