Sum total of cells containing specific text

rob1987

New Member
Joined
Feb 14, 2011
Messages
39
Hello All,

I have a spreadsheet where the cells in a row contain either a number or text and a number. I use the following formula to sum the total of any cell which contains both text and a number:

=SUM(IF(b26:ac26<>"",IF(NOT(ISNUMBER(--LEFT(b26:ac26,1))),--MID(b26:ac26,2,256))))

Can anyone please advise on how I can change this so that I can get it to sum only the cells that contain a specific text, e.g. anything that contains 'M' so just the cells that say M15, M20, M21, etc.

Hope someboday can help - it would be very much appreciated.

Thank you
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I managed to work out a formula in the end, if anyone who reads this is interested or has a similar problem I got the following to work, as an array formula (Ctrl, Shirt + F2):

=SUM(IF(LEFT(B25:AF25)="M",SUBSTITUTE(0&B25:AF25,"M","")+0))
Change the letter and row as needed and should work.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

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