Something other than DATEVALUE

  • Thread starter Thread starter edwardpestian
  • Start date Start date
E

edwardpestian

I have the following formula that uses datevalue to determing what rang
to lookup. I'd rather not use datevalue as each month I will have t
change the value to the first of that month. Is there something I ca
use that will automatically find the first day of the month based o
the month in U4 - which is a drop down menu (Data Validation lis
containing the dates of the month).

=IF(U4-6<DATEVALUE("08/01/2006"),HLOOKUP(U4-6,Data!B23:AF27,4,FALSE)/1000,HLOOKUP(U4-6,Data!B5:AF9,4,FALSE)/1000))
Thanks.

-e
 
With the year in (say) U5:

Date(U5,U4,1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|
| I have the following formula that uses datevalue to determing what range
| to lookup. I'd rather not use datevalue as each month I will have to
| change the value to the first of that month. Is there something I can
| use that will automatically find the first day of the month based on
| the month in U4 - which is a drop down menu (Data Validation list
| containing the dates of the month).
|
| =IF(U4-6<DATEVALUE("08/01/2006"),HLOOKUP(U4-6,Data!B23:AF27,4,FALSE)/1000,HLOOKUP(U4-6,Data!B5:AF9,4,FALSE)/1000))
| Thanks.
|
| -ep
|
|
| --
| edwardpestian
| ------------------------------------------------------------------------
| edwardpestian's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=33809
| View this thread: http://www.excelforum.com/showthread.php?threadid=569742
|
 
So I cannot use the year in U4 too? I tried this, but am getting a #NUM
error.

=IF(U4-6<DATE(U4,U4,1),HLOOKUP(U4-6,Data!B23:AF27,4,FALSE)/1000,HLOOKUP(U4-6,Data!B5:AF9,4,FALSE)/1000)

Regards,

-e
 
Got this to work:

=IF(U4-6<DATE(YEAR(U4),MONTH(U4),DAY(1)),HLOOKUP(U4-6,Data!B23:AF27,4,FALSE)/1000,HLOOKUP(U4-6,Data!B5:AF9,4,FALSE)/1000

-ep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top