Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Summing Cells with Text and Numbers

Trevor,

With your 'numbers in a1 - d1 try this

=SUMPRODUCT((LEFT(A1:D1,1)="S")*(RIGHT(A1:D1,LEN(A 1:D1)-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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default Summing Cells with Text and Numbers

=SUMPRODUCT((LEFT(A1:D1)="S")*(MID(A1:D1,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)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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(A1:D1,1)="S")*(RIGHT(A1:D1,LEN(A 1:D1)-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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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(A1:D1)="S")*(MID(A1:D1,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)


.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default Summing Cells with Text and Numbers

The part (LEFT(A1:D1)="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(A1:D1)="S")*(MID(A1:D1,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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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(A1:D1,1)="S")*(RIGHT(A1:D1,LEN(A 1:D1)-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)

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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(A1:D1)="S")*(MID(A1:D1,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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default Summing Cells with Text and Numbers

=SUMPRODUCT((LEFT(A1:D1)="S")*VALUE((MID(A1:D1,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(A1:D1)="S")*(MID(A1:D1,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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Summing Cells with Text and Numbers

Good morning Bernard,

I triedusing the MID formula and it is still turning up a result of
"#VALUE!" when a cell is blank.

The formula I am using is:
=SUMPRODUCT((LEFT(C29:AG29,1)="S")*VALUE((MID(C29: AG29,2,20))))
The data that is in those cells are the same as below: (EG. V8, S10, T6, B4,
S4... etc and blanks)

Thanks again for your patience.
Trevor

"Bernard Liengme" wrote:

=SUMPRODUCT((LEFT(A1:D1)="S")*VALUE((MID(A1:D1,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(A1:D1)="S")*(MID(A1:D1,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)

.

.



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default Summing Cells with Text and Numbers

Send me a sample file - get my email from my website
best wishes

--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Trevor Little" wrote in message
...
Good morning Bernard,

I triedusing the MID formula and it is still turning up a result of
"#VALUE!" when a cell is blank.

The formula I am using is:
=SUMPRODUCT((LEFT(C29:AG29,1)="S")*VALUE((MID(C29: AG29,2,20))))
The data that is in those cells are the same as below: (EG. V8, S10, T6,
B4,
S4... etc and blanks)

Thanks again for your patience.
Trevor

"Bernard Liengme" wrote:

=SUMPRODUCT((LEFT(A1:D1)="S")*VALUE((MID(A1:D1,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(A1:D1)="S")*(MID(A1:D1,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)

.

.

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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(A1:D1)),IF(LEFT(A1:D1,1)="S",R IGHT(A1:D1,LEN(A1:D1)-1)+0)))

----
Max
Singapore

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with finding numbers within text and summing wallymeister Excel Worksheet Functions 2 December 13th 08 11:25 AM
Summing Numbers and Text in same cell Andrewba Excel Discussion (Misc queries) 3 August 8th 08 03:57 PM
Help with summing numbers in cells that also contain text Michael Slater New Users to Excel 6 September 1st 07 05:38 AM
summing cells with text and numbers val Excel Worksheet Functions 1 August 2nd 06 03:26 AM
Summing cells that contain numbers and text Mango Excel Discussion (Misc queries) 10 May 13th 06 06:18 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"