View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] james.ositis@us.army.mil is offline
external usenet poster
 
Posts: 3
Default How to use HLOOKUP for different sheets depending on results from 2 cells

Well by entering that now I get a #REF! error. But I have data is both
the cells. Not sure what is going on with it
T. Valko wrote:
I'm assuming the lookup tables on each sheet are in the exact same location.

=HLOOKUP(D14, INDIRECT(C14&E14&"!A1:R51"),
MATCH(F14,INDIRECT(C14&E14&"!A2:A51"), 0), TRUE)

Biff

wrote in message
oups.com...
=HLOOKUP(D14, TROOP0!A1:R51, MATCH(F14, TROOP0!A2:A51, 0), TRUE)

The problem is that TROOP0 could be TROOP0, TROOP1, TROOP2, UNARMORED0,
UNARMORED1, UNARMORED2, OR ARMORED0, ARMORED1, ARMORED2.

This depends on what is chosen in 2 previous cells c14 and e14. In c13
the option is given to chose troop, armored, unarmored, and in e14 the
option is given for 0, 1, 2

The sheets are numbered TROOP0, TROOP1 TROOP2 etc, all with varing data
on them.

I hope I'm being clear enough for you to get a mental picture

thanks
T. Valko wrote:
How about providing some details!

I have 2 cells with 3 possiable results each.

Which 2 cells? What are the 3 possible results?

What sheet do you want to use in the lookup based on which result?

What does your formula look like right now?

Biff

wrote in message
oups.com...
I have 2 cells with 3 possiable results each. Depending on the results
from both these cells, determines which sheet needs to be used to
lookup the correct data on. I can get it to work when I specify what
sheet to use, but the sheet is a variable and I cannot figure out how
to get it to work. Thank