Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Something other than DATEVALUE


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...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=569742

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,440
Default Something other than DATEVALUE

With the year in (say) U5:

Date(U5,U4,1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"edwardpestian" wrote in message
news:edwardpestian.2c96jv_1155093912.5036@excelfor um-nospam.com...
|
| 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...o&userid=33809
| View this thread: http://www.excelforum.com/showthread...hreadid=569742
|


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Something other than DATEVALUE

Are the dates in the drop down full dates like 8/9/2006?

If so, replace:

DATEVALUE("08/01/2006")

With:

U4-DAY(U4)+1

Biff

"edwardpestian"
wrote in message
news:edwardpestian.2c96jv_1155093912.5036@excelfor um-nospam.com...

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...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=569742



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Something other than DATEVALUE


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,

-ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=569742

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Something other than DATEVALUE


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


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=569742



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Something other than DATEVALUE

Try it like this:

DATE(YEAR(U4),MONTH(U4),1)

I like this better:

U4-DAY(U4)+1

Biff

"edwardpestian"
wrote in message
news:edwardpestian.2c97pk_1155095411.8235@excelfor um-nospam.com...

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,

-ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:
http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=569742



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date-related problems - max and datevalue Dimitri Ulyinov Excel Discussion (Misc queries) 3 May 28th 06 05:34 PM
DateValue Problem... devrim Excel Worksheet Functions 2 May 24th 06 11:12 AM
DATEVALUE works on one sheet, not another Kim Excel Worksheet Functions 4 January 16th 06 05:21 PM
DATEVALUE QUESTION Carol Excel Worksheet Functions 4 August 4th 05 02:39 PM
Bug in DATEVALUE command in Excel 2002?? MattB-UK Excel Worksheet Functions 1 February 16th 05 01:03 PM


All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"