Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cav
 
Posts: n/a
Default Finding the Max of a related Value Lookup

Hi Folks,
I have been struggling with this for a bit now.
I have items available for purchase in E8:e66 (using list validation).
I have item written in $r8.
I have the actual cost paid for the item for that particular purchase in
h8:h66.
an Item can be purchased multiple times at different prices.

What I am trying to do is create a formula that will lookup all amounts paid
for the specific item type and return the maximum cost paid for that item.
My current formula version only reports back the first one found rather
than the maximum of all types of that item purchased.
=IF(W9=0,"None",MAX(VLOOKUP($R9,$E$8:$H$66,4,FALSE )))
where w9=amount of units purchased.(error removal)
Its really buggung me because its a simple result but a pain to generate.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Finding the Max of a related Value Lookup

One way ..

Put in say, the formula bar for X9,
then array-enter the formula by pressing CTRL+SHIFT+ENTER
(instead of just pressing ENTER):

=IF(W9=0,"None",MAX(IF($E$8:$E$66=R9,$H$8:$H$66)))

X9 returns the max from col H for the item in R9

Copy X9 down

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Cav" wrote in message
...
Hi Folks,
I have been struggling with this for a bit now.
I have items available for purchase in E8:e66 (using list validation).
I have item written in $r8.
I have the actual cost paid for the item for that particular purchase in
h8:h66.
an Item can be purchased multiple times at different prices.

What I am trying to do is create a formula that will lookup all amounts

paid
for the specific item type and return the maximum cost paid for that item.
My current formula version only reports back the first one found rather
than the maximum of all types of that item purchased.
=IF(W9=0,"None",MAX(VLOOKUP($R9,$E$8:$H$66,4,FALSE )))
where w9=amount of units purchased.(error removal)
Its really buggung me because its a simple result but a pain to generate.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cav
 
Posts: n/a
Default Finding the Max of a related Value Lookup

Cheers did the trick nicely.
Thanks

"Max" wrote:

One way ..

Put in say, the formula bar for X9,
then array-enter the formula by pressing CTRL+SHIFT+ENTER
(instead of just pressing ENTER):

=IF(W9=0,"None",MAX(IF($E$8:$E$66=R9,$H$8:$H$66)))

X9 returns the max from col H for the item in R9

Copy X9 down

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Cav" wrote in message
...
Hi Folks,
I have been struggling with this for a bit now.
I have items available for purchase in E8:e66 (using list validation).
I have item written in $r8.
I have the actual cost paid for the item for that particular purchase in
h8:h66.
an Item can be purchased multiple times at different prices.

What I am trying to do is create a formula that will lookup all amounts

paid
for the specific item type and return the maximum cost paid for that item.
My current formula version only reports back the first one found rather
than the maximum of all types of that item purchased.
=IF(W9=0,"None",MAX(VLOOKUP($R9,$E$8:$H$66,4,FALSE )))
where w9=amount of units purchased.(error removal)
Its really buggung me because its a simple result but a pain to generate.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Finding the Max of a related Value Lookup

Glad it worked !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Cav" wrote in message
...
Cheers did the trick nicely.
Thanks



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur
 
Posts: n/a
Default Finding the Max of a related Value Lookup

Hi,

Assume your sheet is set up like this in range A1:B7.

Ashish 100
Sanjay 200
Pongal 300
Ashish 400
Rajesh 500
Suresh 600
Ashish 700

Ashish (in cell A10)

In cell B10, type the following array formula (Ctrl+shift+Enter)

=IF(ISERROR(INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$ 10,ROW($A$1:$A$7)),ROW(1:1)),2)),"",INDEX($A$1:$B$ 7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1 )),2))

Copy this formula down.

you will now get all values which appear against Ashish. Now you can use
the max function in a seperate cell.

Please suit the example to your needs.

Regards,


"Cav" wrote:

Hi Folks,
I have been struggling with this for a bit now.
I have items available for purchase in E8:e66 (using list validation).
I have item written in $r8.
I have the actual cost paid for the item for that particular purchase in
h8:h66.
an Item can be purchased multiple times at different prices.

What I am trying to do is create a formula that will lookup all amounts paid
for the specific item type and return the maximum cost paid for that item.
My current formula version only reports back the first one found rather
than the maximum of all types of that item purchased.
=IF(W9=0,"None",MAX(VLOOKUP($R9,$E$8:$H$66,4,FALSE )))
where w9=amount of units purchased.(error removal)
Its really buggung me because its a simple result but a pain to generate.

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 finding the next value that is GREATER Tim Excel Worksheet Functions 2 September 4th 05 05:27 PM
vlookup - finding the next value that is GREATER than the lookup value? Harold Good Excel Worksheet Functions 6 August 10th 05 10:32 PM
Finding LARGE value within range of lookup table WPA Excel Discussion (Misc queries) 2 June 13th 05 07:41 PM
Lookup Vector > Lookup Value Alec Kolundzic Excel Worksheet Functions 6 June 10th 05 02:14 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


All times are GMT +1. The time now is 11:54 AM.

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"