Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Use array for lookup value, to return array of lookups

I have a row of values that I want to average, but the cells that need to be
averaged contain text that has to be matched to a numerical value for the
purpose of averaging.

eg "Fair","Poor","Excellent","Poor" etc etc as values in the row

where
Excellent = 100
Good = 85
Fair = 75
Poor = 50

So for a row where the text data is in C2:T2 and the lookup table with the
corresponding numerical values is called range "Numerical_LU", I'm trying to
use the following formula in C1:
{=average(vlookup(C2:T2,Numerical_LU,2,0))}

But all I can get is the value of the lookup for the first cell (C2). Is
there are way to get vlookup to evaluate the whole array of C2:T2 and return
the results as an array?

Cheers,

Glen
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Use array for lookup value, to return array of lookups

Try this:

=SUMPRODUCT(SUMIF(INDEX(Numerical_LU,,1),C2:T2,IND EX(Numerical_LU,,2)))/COUNTA(C2:T2)

--
Biff
Microsoft Excel MVP


"Glen" wrote in message
...
I have a row of values that I want to average, but the cells that need to
be
averaged contain text that has to be matched to a numerical value for the
purpose of averaging.

eg "Fair","Poor","Excellent","Poor" etc etc as values in the row

where
Excellent = 100
Good = 85
Fair = 75
Poor = 50

So for a row where the text data is in C2:T2 and the lookup table with the
corresponding numerical values is called range "Numerical_LU", I'm trying
to
use the following formula in C1:
{=average(vlookup(C2:T2,Numerical_LU,2,0))}

But all I can get is the value of the lookup for the first cell (C2). Is
there are way to get vlookup to evaluate the whole array of C2:T2 and
return
the results as an array?

Cheers,

Glen



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Use array for lookup value, to return array of lookups

Works a treat.

Cheers, Glen

"T. Valko" wrote:

Try this:

=SUMPRODUCT(SUMIF(INDEX(Numerical_LU,,1),C2:T2,IND EX(Numerical_LU,,2)))/COUNTA(C2:T2)

--
Biff
Microsoft Excel MVP


"Glen" wrote in message
...
I have a row of values that I want to average, but the cells that need to
be
averaged contain text that has to be matched to a numerical value for the
purpose of averaging.

eg "Fair","Poor","Excellent","Poor" etc etc as values in the row

where
Excellent = 100
Good = 85
Fair = 75
Poor = 50

So for a row where the text data is in C2:T2 and the lookup table with the
corresponding numerical values is called range "Numerical_LU", I'm trying
to
use the following formula in C1:
{=average(vlookup(C2:T2,Numerical_LU,2,0))}

But all I can get is the value of the lookup for the first cell (C2). Is
there are way to get vlookup to evaluate the whole array of C2:T2 and
return
the results as an array?

Cheers,

Glen




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Use array for lookup value, to return array of lookups

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Glen" wrote in message
...
Works a treat.

Cheers, Glen

"T. Valko" wrote:

Try this:

=SUMPRODUCT(SUMIF(INDEX(Numerical_LU,,1),C2:T2,IND EX(Numerical_LU,,2)))/COUNTA(C2:T2)

--
Biff
Microsoft Excel MVP


"Glen" wrote in message
...
I have a row of values that I want to average, but the cells that need
to
be
averaged contain text that has to be matched to a numerical value for
the
purpose of averaging.

eg "Fair","Poor","Excellent","Poor" etc etc as values in the row

where
Excellent = 100
Good = 85
Fair = 75
Poor = 50

So for a row where the text data is in C2:T2 and the lookup table with
the
corresponding numerical values is called range "Numerical_LU", I'm
trying
to
use the following formula in C1:
{=average(vlookup(C2:T2,Numerical_LU,2,0))}

But all I can get is the value of the lookup for the first cell (C2).
Is
there are way to get vlookup to evaluate the whole array of C2:T2 and
return
the results as an array?

Cheers,

Glen






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
Lookup text in array & return cell reference Matt Excel Discussion (Misc queries) 5 April 25th 09 07:56 AM
Return an array based on a lookup seanss Excel Worksheet Functions 2 September 25th 08 06:15 AM
Lookup Value in Range/Array and Return Column Header Value [email protected] Excel Discussion (Misc queries) 3 June 16th 06 07:05 PM
Lookup Value in Range/Array and Return Column Header Value [email protected] Excel Worksheet Functions 3 June 16th 06 07:05 PM
VLOOKUP CONDITION TO RETURN BLANK CELL WHERE LOOKUP VALUE IS NOT IN TABLE ARRAY Scott Lolmaugh Excel Worksheet Functions 3 March 9th 06 11:05 PM


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