Sum Cells with multiple Numbers and multiple Text, within a cell

Help_Me_Excel

New Member
Joined
Jun 13, 2011
Messages
14
I am trying to sum a few cells that contain numbers and text, but I only want to sum the numbers that have a K in behind it. For example one cell could have 30K 12.5% 25K 13.0% and I want it to add to 55, just what is in front of the K's. I am using Excel 2007<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I tried using <o:p></o:p>
=SUM(IF(C17:C18<>"",SUBSTITUTE(SUBSTITUTE(C17:C18,"K",""),"%","")+0))
Unfortunately that does not work, anybody have any suggestions??

Cell C
Row 17 30K 12.5% 25K 13.0%


Row 18 50K 14.0%


Row 19
=SUM(IF(C17:C18<>"",SUBSTITUTE(SUBSTITUTE(C17:C18,"K",""),"%","")+0))

Should total 105
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
bit long, but....for a vertical range of cells try this

=SUM((0&MID(TRANSPOSE(C17:C20),FIND("^^",SUBSTITUTE(TRANSPOSE(C17:C20),"K","^^",ROW(INDIRECT("1:"&MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K",""))))))&REPT("00^^",MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K","")))))-2,2))+0)

confirmed with CTRL+SHIFT+ENTER

assumes that values will be only 1 or 2 digits....
 
Upvote 0
This equation assumes 1 or 2 digits, what if it were 3 digits what would I have to change or add in this formula?

=SUM((0&MID(TRANSPOSE(C17:C20),FIND("^^",SUBSTITUTE(TRANSPOSE(C17:C20),"K","^^",ROW(INDIRECT("1:"&MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K",""))))))&REPT("00^^",MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K","")))))-2,2))+0)
 
Upvote 0
Try this version.....

=SUM((0&TRIM(MID(TRANSPOSE(SUBSTITUTE(C17:C20," "," ")),FIND("^^",SUBSTITUTE(TRANSPOSE(SUBSTITUTE(C17:C20," "," ")),"K","^^",ROW(INDIRECT("1:"&MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K",""))))))&REPT("000^^",MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K","")))))-3,3)))+0)

still confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
any idea why I am getting a #value error, when I use this array

=SUM((0&TRIM(MID(TRANSPOSE(SUBSTITUTE(C17:C20," "," ")),FIND("^^",SUBSTITUTE(TRANSPOSE(SUBSTITUTE(C17:C20," "," ")),"K","^^",ROW(INDIRECT("1:"&MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K",""))))))&REPT("000^^",MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K","")))))-3,3)))+0)

I used CTRL + SHIFT + ENTER
 
Upvote 0
OK sorry, yes, the formula works OK but when I post it to the board some of the double spaces become single spaces - this should fix it

=SUM((0&TRIM(MID(TRANSPOSE(SUBSTITUTE(C17:C20," ",REPT(" ",2))),FIND("^^",SUBSTITUTE(TRANSPOSE(SUBSTITUTE(C17:C20," ",REPT(" ",2))),"K","^^",ROW(INDIRECT("1:"&MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K",""))))))&REPT("000^^",MAX(LEN(C17:C20)-LEN(SUBSTITUTE(C17:C20,"K","")))))-3,3)))+0)
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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