View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Lookup Functions

Yep,read that one wrong.... The issue will be trying to differentiate
between duplicate date values.

It might be handy for the OP to elaborate on what the end game is, as it
would seem that if the '1s' are to distinguish if they were sold that day
for example, then why does it have dupe dates, when you could just enter
'1s' under several columns.

What I'm saying is, there may be a better data structure to get the desired
result.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Toppers" wrote in message
...
Nick,
Me again! (thanks for your previous reply another posting).

I believe the need is too find the column which has a 1 in for a given row
(determined by date), and then determine the column header. Your solution
gives the value of the interesect of Date/Type which could be zero i.e.
assumes we know the Type.

Also in the test table, there are two dates the same so VLOOKUP chooses
the
first: this maybe just a problem with data i.e. there cannot be two dates
the
same.

Apologies if I misunderstand the problem and/or solution.

"Nick Hodge" wrote:

With your data in a table covering A2:E5 and with the two parameters in
A8
(Date) and A9 (Type), you could use a combination of VLOOKUP and MATCH

=VLOOKUP($A$8,$A$2:$E$5,MATCH($A$9,$B$1:$E$1,0)+1, FALSE)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"SmilingPolitely" wrote in
message
...
I have a spreadsheet that might be something like:

Apple Banana Chips Drink
01/05 0 0 0 1
02/05 0 1 0 0
04/05 1 0 0 0
04/05 0 0 1 0


What I need to do is read the value in the top row, given a particular
date (from the first column) to return the value from the top row where
the intersection of the row and column is 1

I cannot get my head around the lookup functions, lookup, hlookup,
vlookup
etc to allow me to return the axis value given the intersection value!

I hope someone can help, or at least point me in the right direction?

Thanks in advance.