# Retrieve Column Header for Specific Data in a Row

#### Anthony Rawlings

nalyzing surplus inventory compared to sales history in 19 locations for possible cross leveling to optimize inventory.

I have determined the number of possible moves and other data but I'm having problems retrieving my column header specific possible move locations. I've seen and tried lots of examples but few have multiple types (item#) and multiple locations (Whse 100 - 950). I see examples like Apples, Oranges and 1, 2, 3, 4 etc. But nothing about Apples, Apples, Apples, and 2, 2, 2, etc.

You might can see that I have pulled the top six sales locations (AE - AP) for possible moves of the surplus inventory (D - Surplus). I can't seem to find a formula that will match the sales data in AF for example and return that Whse 500 was where those sales occurred.

I plan to go back and exclude the surplus whse (A) from the possible move options.

Any help is appreciated!
Anthony

#### Anthony Rawlings

I guess I should add that the formula in AE5 is =MATCHIF(AF5=INDEX(E5:W5,,E4:W4))

AE6 is another formula I tried: =INDEX(WAREHOUSES,MATCH(AF6,E6:W6)+1,2)

#### Anthony Rawlings

Figured it out! I'll post it in case someone ever has a similar need.

=INDEX(\$E\$4:\$W\$4,0,(MATCH(AF5,E5:W5,0)))

#### Becky

##### Webmistress
Thanks for sharing the solution!