Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PageRow
 
Posts: n/a
Default How do I sum numbers in cells that have text?

I am trying to add up numbers in cells that have letters in them. My problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default How do I sum numbers in cells that have text?

Hi

If your input is in D2 to F2, try this in A2
=SUMPRODUCT((LEFT(D2:F2,1)="A")*(RIGHT(D2:F2)))
and this in S2
=SUMPRODUCT((LEFT(D2:F2,1)="S")*(RIGHT(D2:F2)))

Hope this helps.
Andy.

"PageRow" wrote in message
...
I am trying to add up numbers in cells that have letters in them. My
problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula
to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default How do I sum numbers in cells that have text?

On Thu, 9 Mar 2006 13:39:31 -0800, PageRow
wrote:

I am trying to add up numbers in cells that have letters in them. My problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks


With your three values in A1:C3

D1 is
=SUMPRODUCT((LEFT($A1:$C1,1)="A")*(RIGHT($A$1:$C$1 ,LEN($A1:$C1)-1)))

E1 is
=SUMPRODUCT((LEFT($A1:$C1,1)="S")*(RIGHT($A$2:$C$2 ,LEN($A1:$C1)-1)))


Change the A:E range as appropriate. These allow for more than one
digit, e.g. A25. If there's only one digit in the cell then you can
leave out the LEN($A1:$C1)-1 bit and just have 1.

HTH


Richard Buttrey
__
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default How do I sum numbers in cells that have text?

This one worked on your test data:

=SUMPRODUCT(--(LEFT(A1:A3,1)="A"),--(RIGHT(A1:A3)))

--
Kevin Vaughn


"PageRow" wrote:

I am trying to add up numbers in cells that have letters in them. My problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PageRow
 
Posts: n/a
Default How do I sum numbers in cells that have text?

Thanks for your help, you three. Unfortunately, none of the formulas are
working! I am doing a cut and paste right into my formula bar, but I am
getting a VALUE error.
Here are some specifics of my entries:

My cell range is D5:Q5, and the cell entry could be [A#], or [S#] (where #
is a digit 1-9). I have two cells at S5 and V5 (A and S values,
respectively) that I want the # values summed up.

I was trying IF and VALUE and RIGHT statements, but I can't get those to
work either. Thanks for helping!

"PageRow" wrote:

I am trying to add up numbers in cells that have letters in them. My problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default How do I sum numbers in cells that have text?

The following array entered formulae (entered using cntl-shift-enter) assume
that only the first character is non numeric. If the characters are non
numeric after the first character, you will get a Value error (any in the
range.)

=SUM(IF(LEFT($D5:$Q5, 1) = "A",VALUE(RIGHT($D5:$Q5,LEN($D5:$Q5) -1)), 0))

and

=SUM(IF(LEFT($D5:$Q5, 1) = "S",VALUE(RIGHT($D5:$Q5,LEN($D5:$Q5) -1)), 0))

--
Kevin Vaughn


"PageRow" wrote:

Thanks for your help, you three. Unfortunately, none of the formulas are
working! I am doing a cut and paste right into my formula bar, but I am
getting a VALUE error.
Here are some specifics of my entries:

My cell range is D5:Q5, and the cell entry could be [A#], or [S#] (where #
is a digit 1-9). I have two cells at S5 and V5 (A and S values,
respectively) that I want the # values summed up.

I was trying IF and VALUE and RIGHT statements, but I can't get those to
work either. Thanks for helping!

"PageRow" wrote:

I am trying to add up numbers in cells that have letters in them. My problem
is that there are two types of letters, and I want them to be added in an
adjacent cell. Confusing? Yeah.

OK, I want to add up the numbers from a row into two columns: "A" and "S".
The user will input, say "A8", "S3", and "A4" in one row. I need a formula to
recognize the difference and give an output of "12" in the "A" column, and
"3" in the "S" column.

I've tried VALUE and RIGHT, but it won't let me do a range of cells, or
recognize the difference between "A" and "S".

Thanks

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
question about removing text from cells, leaving numbers JPN5804 Excel Discussion (Misc queries) 3 November 28th 05 05:55 PM
Linked cells and text boxes Alexlondon11 Excel Discussion (Misc queries) 2 November 23rd 05 04:10 PM
Counting Occurrence of Text within Text in Cells in Range. Jeremy N. Excel Worksheet Functions 1 September 8th 05 05:16 AM
Cells formated as numbers are calculating like text MM_BAM Excel Discussion (Misc queries) 4 July 7th 05 01:29 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM


All times are GMT +1. The time now is 12:10 AM.

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

About Us

"It's about Microsoft Excel"