Hlookup for max value

Pow3R

New Member
Joined
Aug 17, 2017
Messages
6
Hello all, I have a range of data as table below and looking for the max cost for each item.
Wondering how can I use HLOOKUP to get the max cost.
Thanks for advance!

Item AItem BItem CItem AItem DItem B
Cost 124510920
Cost 211822485

<colgroup><col width="64" span="7" style="width:48pt"> </colgroup><tbody>
</tbody>


Result

Item AItem B
Cost 11020
Cost 2118

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello all, I have a range of data as table below and looking for the max cost for each item.
Wondering how can I use HLOOKUP to get the max cost.
Thanks for advance!

Item AItem BItem CItem AItem DItem B
Cost 124510920
Cost 211822485

<tbody>
</tbody>


Result

Item AItem B
Cost 11020
Cost 2118

<tbody>
</tbody>


B8 = MAX(IF($B$1:$G$1=B$7,$B2:$G2,0)) press CTRL+SHIFT+ENTER

where B7=Item A
 
Upvote 0
Hi jarjar, thanks for your reply.
If lets say I have N cost, and i am only looking for the max "cost N-40" for each item, may i know how should i do?

not sure I understand but try this:

=MAX(IF($B$1:$G$1=B$7,$B2:$G2-40,0)) press CTRL+SHIFT+ENTER
 
Upvote 0
Sorry for being unclear.
Lets say i have "cost 1-100" under column A and i am only looking for max "cost 40" for each item.
 
Upvote 0
Sorry for being unclear.
Lets say i have "cost 1-100" under column A and i am only looking for max "cost 40" for each item.

Let's keep it 4 (you can generalize the solution yourself to any n (of N).

Your sample lists cost 1, cost 2, under Item A. Are you interested in the max of the first 4 cost 1 values or what?
 
Upvote 0
Hihi, I am interested in the maximum cost 4 for item A to item C.

In order to exclude misunderstings to a maximum, please try to post a sample with the output that goes with it, obeying "the maximum cost 4 for item A to item C.
 
Upvote 0
Hi Aladin,
Sorry for being unclear.
here's the sample for better understanding.

Item AItem BItem CItem AItem CItem D
Cost 1
Cost 2
Cost 3
Cost 4401029381532
Looking for the maximum value of "cost 4" for each item
Result
Item AItem BItem CItem D
Cost 440101532

<colgroup><col span="7"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top