Sum Cells Containing Text And Numbers

pg24

New Member
Joined
Feb 8, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I was hoping someone can help me with a way to calculate amount of Pens only

1612767584272.png


The SUMIF formula counts the cell with Books as well, would there be a way to exclude "Books" in the calculation?

Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this:
Book1
ABCDEF
1RulerCalculatorsPens & BooksComment
24040 Pens200
32020 Pens
460
54020 Pens, 20 Books
640
74040 Pens
82020 Pens
92020 Pens
104040 Pens
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(IF(ISNUMBER(LEFT($D$2:$D$10,2)*1),LEFT($D$2:$D$10,2)*1,0)*(MID($D$2:$D$10,4,4)="Pens"))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
This would allow for Pens even if not listed first in the cell.

21 02 08.xlsm
DEF
1CommentPens
240 Pens200
320 Pens
460 Rulers
520 Pens, 20 Books
640 Calculators
73 Calculators, 40 Pens
820 Pens
920 Pens
101 calculator, 40 Pens, 3 Rulers
Pens
Cell Formulas
RangeFormula
F2F2=SUM(--RIGHT(SUBSTITUTE(TRIM(IFERROR(LEFT(D2:D10,SEARCH(F1,D2:D10)-1),0))," ",REPT(" ",20)),20))
 
Upvote 0
Solution
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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