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 #Value! error when evaluating data in a cell range

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default #Value! error when evaluating data in a cell range

Simon Woods wrote:
I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?



Lookup "About array formulas and array constants" in the help file.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default #Value! error when evaluating data in a cell range

Hi

With no blank cell in the range try

=SUMPRODUCT((RIGHT(L49:CY49,3)="ABC")*(LEFT(L49:CY 49,LEN(L49:CY49)-3)))

Mike

"Simon Woods" wrote:

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default #Value! error when evaluating data in a cell range

On reflection this is batter

=SUM(IF(RIGHT(L49:CY49,3)="abc",LEFT(L49:CY49,LEN( L49:CY49)-3)*1))

'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"Mike H" wrote:

Hi

With no blank cell in the range try

=SUMPRODUCT((RIGHT(L49:CY49,3)="ABC")*(LEFT(L49:CY 49,LEN(L49:CY49)-3)))

Mike

"Simon Woods" wrote:

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default #Value! error when evaluating data in a cell range

Cheers Glenn, that sorted out the #value! problem. Still isn't working yet
though, just returns 0 instead.


"Glenn" wrote:


Lookup "About array formulas and array constants" in the help file.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default #Value! error when evaluating data in a cell range

That works perfectly, thank you.

One question, though. What does the *1 do at the end of the LEN() statement
that means it works, but the same statement without it does not? Not
critical, I'm just curious

"Mike H" wrote:

On reflection this is batter

=SUM(IF(RIGHT(L49:CY49,3)="abc",LEFT(L49:CY49,LEN( L49:CY49)-3)*1))

'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"Mike H" wrote:

Hi

With no blank cell in the range try

=SUMPRODUCT((RIGHT(L49:CY49,3)="ABC")*(LEFT(L49:CY 49,LEN(L49:CY49)-3)))

Mike

"Simon Woods" wrote:

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default #Value! error when evaluating data in a cell range

Hi,

the string being evaluated is text so the formula returns text so
multiplying the text number ("22") *1 turns it into a real number (22).

Mike

"Simon Woods" wrote:

That works perfectly, thank you.

One question, though. What does the *1 do at the end of the LEN() statement
that means it works, but the same statement without it does not? Not
critical, I'm just curious

"Mike H" wrote:

On reflection this is batter

=SUM(IF(RIGHT(L49:CY49,3)="abc",LEFT(L49:CY49,LEN( L49:CY49)-3)*1))

'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"Mike H" wrote:

Hi

With no blank cell in the range try

=SUMPRODUCT((RIGHT(L49:CY49,3)="ABC")*(LEFT(L49:CY 49,LEN(L49:CY49)-3)))

Mike

"Simon Woods" wrote:

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default #Value! error when evaluating data in a cell range

Apologies,

i forgot to mention thanks for the feed back and how refreshing it is to
have a poster enquire as to how their problem is solved.

Mike

"Mike H" wrote:

Hi,

the string being evaluated is text so the formula returns text so
multiplying the text number ("22") *1 turns it into a real number (22).

Mike

"Simon Woods" wrote:

That works perfectly, thank you.

One question, though. What does the *1 do at the end of the LEN() statement
that means it works, but the same statement without it does not? Not
critical, I'm just curious

"Mike H" wrote:

On reflection this is batter

=SUM(IF(RIGHT(L49:CY49,3)="abc",LEFT(L49:CY49,LEN( L49:CY49)-3)*1))

'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"Mike H" wrote:

Hi

With no blank cell in the range try

=SUMPRODUCT((RIGHT(L49:CY49,3)="ABC")*(LEFT(L49:CY 49,LEN(L49:CY49)-3)))

Mike

"Simon Woods" wrote:

I have a worksheet where I need to calculate the sum of a range of cells
containing a text string and a number, for example:

If I had the cell values:
8ABC, 10ABC, 2XYZ
And I wanted to calculate the sum of the numeric portions of cells
containing the strong ABC, the result would be 18.

I know the text string will always be 3 characters long, and so I've tried
this:

=SUM(IF(RIGHT($L49:$CY49,3)="ABC",LEFT($L49:$CY49, LEN($L49:$CY49)-3)))

Which, I think, should check all cells in the range L49 to CY49 to see if
the rightmost 3 characters are"ABC" and, where that's true, assign the
numeric value of that cell by trimming the text string (so 10ABC becomes 10
and so on) and then adding those values together.

But, the formula dies on the first step, returning #value! for the function
RIGHT($L49:CY49). If I click the Insert Function button, the function appears
to evaluate correctly in the "Function arguments" dialogue box.

I've seen a similar function work in another spreadsheet, but the function
is surrounded by curly braces in the function bar. I don't know if that makes
a difference.

Any ideas what I'm doing wrong?


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
Macro error, range object need data? Daniel Charts and Charting in Excel 1 June 15th 07 11:27 AM
Named range as chart data reference (error) Keith R Charts and Charting in Excel 8 June 13th 07 09:06 PM
Evaluating a range TwoDot Excel Discussion (Misc queries) 5 March 5th 07 08:59 PM
How to have an error popup once range cell amount is greater than Daniel Bunt Excel Discussion (Misc queries) 2 January 27th 07 02:58 PM
evaluating text cell contents Dave B Excel Discussion (Misc queries) 1 January 3rd 06 10:51 PM


All times are GMT +1. The time now is 10:18 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"