Thread: Look-up
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Look-up

Not quite sure what you mean by "return a value in the usual fashion". But
I'll give this a couple of shots.

For my example, I just used a short table from A1 to G4 for the weekdays,
and assumed a return value you want is in column H on those rows.

I put a test row at A7:G7 and this formula into H7:
=SUMPRODUCT(--($A$1:$A$4=A7),--($B$1:$B$4=B7),--($C$1:$C$4=C7),--($D$1:$D$4=D7),--($E$1:$E$4=E7),--($F$1:$F$4=F7),--($G$1:$G$4=G7),$H$1:$H$4)

The 'flaw' in that formula is that it doesn't actually return an individual
value if there are rows in the table at A1:G4 that are duplicates - it will
return the sum of the values in column H for all rows in that table that are
duplicates.

If you just want an indicator of duplicates, then this formula in H7 should
help:
=IF(SUMPRODUCT(--($A$1:$A$4=A7),--($B$1:$B$4=B7),--($C$1:$C$4=C7),--($D$1:$D$4=D7),--($E$1:$E$4=E7),--($F$1:$F$4=F7),--($G$1:$G$4=G7))<0,"Duplicate","")

That will put the word "Duplicate" into the H# test cell (H7 in my example)
if the values in A7:G7 are also in the table in the same sequence, and leave
the cell blank if not. The formula returns 1 if there's one or more
duplicate rows in A1:A4, and a zero if not. It's basically a True or False
test.

Hope this helps some. And maybe someone will come up with a tighter solution.
"Nick C" wrote:

I am trying to compare rows of information. If all cells in a row compare to
al cells in the look-up table, then I want it to return a value in the usual
fashion. An example of the data is

S M T W T F S
7.5 7.5 7.5
Each row is unique, but it must recognise the blanks to remain unique.

Any ideas?

Thanks,

Nick