sum column a if column b contains specific text

Luigi802

Board Regular
Joined
Oct 16, 2014
Messages
80
So I don't think there is a single formula to sum certain columns that contain specific text if that text is in a cell with other text, for example

AB
$657.34XX Oil company 234
$34.20Gas
$432.98Car payment
$653.97Oil supplier
$400.00Oil
$56.50Gas
$678.76XX Oil company 236

<tbody>
</tbody>

I want to sum the amount in column A based on which ever cells in column B contain the word oil, easy to do if the rest of the text in the cell is the same but not sure how to do this simply with other different text in the same cells with the word oil.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
OK try this:

=SUM(IF(ISERROR(FIND("Oil",B1:B7))=FALSE,1,0)*A1:A7)

Confirm with Ctrl Shift Enter
 
Upvote 0
=sumif (B1:B10,"*oil*",A1:A10)

if you use cell ref.
say C1 contains "oil"


=sumif (B1:B10,"*"&C1&"*",A1:A10)

*oil -> xxxoil
*oil* -> xxxoilxxx
 
Upvote 0
=sumif (B1:B10,"*oil*",A1:A10)

if you use cell ref.
say C1 contains "oil"


=sumif (B1:B10,"*"&C1&"*",A1:A10)

*oil -> xxxoil
*oil* -> xxxoilxxx
Yes this works fin and I've been using this but I want to eliminate the extra column
 
Upvote 0

Forum statistics

Threads
1,215,938
Messages
6,127,777
Members
449,406
Latest member
Pavesib

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