If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Summing Cells with Text and Numbers
Is it possible to use the Sumif function to add numbers with a specific
designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) |
#2
|
|||
|
|||
Summing Cells with Text and Numbers
Trevor,
With your 'numbers in a1 - d1 try this =SUMPRODUCT((LEFT(A11,1)="S")*(RIGHT(A11,LEN(A 11)-1))) Mike "Trevor Little" wrote: Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) |
#3
|
|||
|
|||
Summing Cells with Text and Numbers
Thanks a lot Mike, the formula worked perfectly. How does the "Len(x:x)"
Formula work? is it just the leftovers of the text? (Just as one addition, I found that it wouldn't quite work for me until I used the "Value(...)" formula in front of the number I wanted to use.) Thanks again. "Mike H" wrote: Trevor, With your 'numbers in a1 - d1 try this =SUMPRODUCT((LEFT(A11,1)="S")*(RIGHT(A11,LEN(A 11)-1))) Mike "Trevor Little" wrote: Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) |
#4
|
|||
|
|||
Summing Cells with Text and Numbers
Hi Mike,
I just came across one problem with the formula that I haven't been able to figure out. It doesn't seem to work, if 1 of the cells in the array is blank... is there a way of putting in a condition where it ignores the blank cells? Thanks again. "Mike H" wrote: Trevor, With your 'numbers in a1 - d1 try this =SUMPRODUCT((LEFT(A11,1)="S")*(RIGHT(A11,LEN(A 11)-1))) Mike "Trevor Little" wrote: Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) |
#5
|
|||
|
|||
Summing Cells with Text and Numbers
... It doesn't seem to work, if 1 of the cells in the array is
blank... is there a way of putting in a condition where it ignores the blank cells? Try this variant, array-enter (press CTRL+SHIFT+ENTER): =SUM(IF(NOT(ISBLANK(A11)),IF(LEFT(A11,1)="S",R IGHT(A11,LEN(A11)-1)+0))) ---- Max Singapore |
#6
|
|||
|
|||
Summing Cells with Text and Numbers
=SUMPRODUCT((LEFT(A11)="S")*(MID(A11,2,20)))
best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Trevor Little" Trevor wrote in message ... Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) |
#7
|
|||
|
|||
Summing Cells with Text and Numbers
Thanks Bernard, This formula worked perfectly for me as well.
The same with the note I left on Mike's formula, I also had to use the "value(..)" formula in order to have it it take the last part of the number as a "number" value. Thanks again. "Bernard Liengme" wrote: =SUMPRODUCT((LEFT(A11)="S")*(MID(A11,2,20))) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Trevor Little" Trevor wrote in message ... Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) . |
#8
|
|||
|
|||
Summing Cells with Text and Numbers
The part (LEFT(A11)="S") will return Boolean FALSE/TRUE
But when Excel does math (here multiplication) on Boolean it converts this to 0/1 Similarly text that can be converted to numbers will get cohered to numbers with in a math operation. So VALUE is not needed best wishes Bernard "Trevor Little" wrote in message ... Thanks Bernard, This formula worked perfectly for me as well. The same with the note I left on Mike's formula, I also had to use the "value(..)" formula in order to have it it take the last part of the number as a "number" value. Thanks again. "Bernard Liengme" wrote: =SUMPRODUCT((LEFT(A11)="S")*(MID(A11,2,20))) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Trevor Little" Trevor wrote in message ... Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) . |
#9
|
|||
|
|||
Summing Cells with Text and Numbers
Hi Bernard,
I just came across one problem with the formula that I haven't been able to figure out. It doesn't seem to work, if 1 of the cells in the array is blank... is there a way of putting in a condition where it ignores the blank cells? Thanks again. "Bernard Liengme" wrote: =SUMPRODUCT((LEFT(A11)="S")*(MID(A11,2,20))) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Trevor Little" Trevor wrote in message ... Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) . |
#10
|
|||
|
|||
Summing Cells with Text and Numbers
=SUMPRODUCT((LEFT(A11)="S")*VALUE((MID(A11,2,2 0))))
VALUE is needed if there are any empty cells Bernard "Trevor Little" wrote in message ... Hi Bernard, I just came across one problem with the formula that I haven't been able to figure out. It doesn't seem to work, if 1 of the cells in the array is blank... is there a way of putting in a condition where it ignores the blank cells? Thanks again. "Bernard Liengme" wrote: =SUMPRODUCT((LEFT(A11)="S")*(MID(A11,2,20))) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Trevor Little" Trevor wrote in message ... Is it possible to use the Sumif function to add numbers with a specific designator in front of it? Eg. A row contains strings like: S8, S10, V5, S5 Is there a formula that can total the S's? (Total would be 23) . |
|
Thread Tools | |
Display Modes | |
|
|