Dynamic sellection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to select different cells depending the date of day?
Is possible? For example for 01/03/06 select A1, 02/03/06 select A2 ...

Thank you in advance.
 
Toni said:
I want to select different cells depending the date of day?
Is possible? For example for 01/03/06 select A1, 02/03/06 select A2 ...

Thank you in advance.

Almost anything is possible in Excel :)
VLOOKUP and INDEX(MATCH()) can both help out here

Replace (Y)ear, (M)onth and (D)ay with values you require
or Replace DATE(Y,M,D) with a Cell that contains a date to lookup

=================================================================
Solution 1
=VLOOKUP(DATE(Y,M,D),$A$1:$B$10,2,FALSE)

VLOOKUP requires the first column to be the one being searched
So you would need to put the dates in column A and use column B as the
Cell you are trying to retrieve.
The FALSE at the end just tells the lookup that the values can be in any
order and that it must find an exact match.

=================================================================
Solution 2
=INDEX($A$1:$A$10,MATCH(DATE(Y,M,D),$B$1:$B$10,0))

Put the dates in Column B (or anywhere else) they just need to be in the
order you wish to retrieve information from Column A
The zero near the end of the formula does the same as FALSE for VLOOKUP

=================================================================

George
 
Back
Top