Automated Price Look Up (How to do)

B1313

New Member
Joined
Sep 20, 2015
Messages
32
Hello,

I am trying to get values from a table that looks like this (simplified to a comprehensive and complete example):

IE4KZiZ.png


Anybody have an idea of what function I can use if I have both the size and name of the item (ie L, Hat) to retrieve the price?

I am using a "table" (that is not made as a table) to store prices while I make another table that reports out stats and one section is based on retrieving prices based on some sizes & item names. So I want to automate the retrieving of the price.

Thanks :)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
if you put 8 against Tshirt ES S M L etc etc it is very easy with offset match

match down column A to find size M and match across row 2 to find sweater

=offset($a$2,match("M",a3:a12,0),match("Sweater",b2:e2,0))
 
Upvote 0
Hey, thanks for the answer. It sparked a thought and I think I may have the ideal solution:

Code:
=INDEX($A$2:$E$12, MATCH(...), MATCH(...))

Where the MATCH arguments can be either static, mixed, or relative references just as long as they correlate between sizes and types. I also found a solution to making merged cell values show (via a custom function) from google.

Code:
Function MERGEVAL(merged_cell As Range)
    If merged_cell.Count = 1 Then
        MERGEVAL = merged_cell.MergeArea(1, 1)
    Else
        MERGEVAL = CVErr(xlErrRef)
    End If
End Function

So the final formula would be:

Code:
=MERGEVAL(INDEX($A$2:$E$12, MATCH(...), MATCH(...)))

:)

So for an example (eg M Hat should return 10):

Code:
=MERGEVAL(INDEX($A$2:$E$12, MATCH("M", $A$3:$A$12, 0), MATCH("Hat", $A$2:$E$2, 0)))
 
Upvote 0
I made a small error in the example...here is the correction:

Code:
=MERGEVAL(INDEX($A$2:$E$12, MATCH("M", $A$2:$A$12, 0), MATCH("Hat", $A$2:$E$2, 0)))
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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