Sum specific amount if cell contains certain value

Taggit89

New Member
Joined
Dec 3, 2015
Messages
3
Hello to all,

First post in the forum and I need HELP!

Is there a formula that can sum a specific amount if a cell contains a certain value?

Example:

Apple =SUMIF(A1,”Apple”,500) would return 500

Apple, Banana, Oranges =SUMIF(A3,”Apple”,500)&SUMIF(A3,”Banana”,500)&SUMIF(A3,”Oranges”,500) would return 1500

Thanks in advance!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I presume you mean for this to apply to a range, not just A1?
try this...
=SUM(sumIF(A1:A1000,{"Apple","Orange","banana"}))

If you just want to test for A1, then you dont need the SUM...
=IF(Or(a1="apple',A1=Banana",A1="Orange),500,0)
 
Upvote 0
This would only be for A1

Also the different values would equal different amounts so I wouldn't be able to set everything to 500. My bad on not posing that differently in my example. Here is what I came up with:

=IF(ISNUMBER(SEARCH("*apple*",A1)),SUM(500))+IF(ISNUMBER(SEARCH("*banana*",A1)),SUM(500))

I have multiple products that I need to easily price listed within one cell and I'll be copying the formula down to price each cell in the column.

Think of this as pricing a basket of groceries. I have to know the total price of each basket individually.

I'm hoping this works, thank you for your help!
 
Upvote 0
Confused :confused:

Would A1 contain both Apple AND banana, or just 1 or those?
If only 1, then you could still use something like...
=SUM(sumIF(A1,{"Apple","Orange","banana"},500))
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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