Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shaun
 
Posts: n/a
Default Using IF function with Dates as parameters

Appreciate advice in advance..

I have set calendar dates equating to a Reporting Month ie

01/01/06 - 31/01/06 = M01
01/02/06 - 28/02/06 = M02

now if I have a cell that relates to when a contract closes (eg 15/01/06)
how can I set the formula in next cell to equal the "M01"

Will need to run this out for the whole year, so not sure I can build that
many < nested IF functions

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Creator
 
Posts: n/a
Default Using IF function with Dates as parameters

Shaun,
maybe you can try it another way using the VLOOKUP function rather than the
IF function. It's much simpler. Create a 2 column table in the spreadsheet.
On the left you list the first day of each month and on the right you list
your output, i.e. M01, M02 etc. one below the other as shown (continue to the
end of the year);

A B
1 1/1/2006 M01
2 2/1/2006 M02
3 3/1/2006 M03
4 4/1/2006 M04
5 5/1/2006 M05

Put your contract date in G1 (or any other cell) then input this formula
anywhere;
=VLOOKUP(G1,A1:B5,2,TRUE)
The output should be the period you're looking for.
Hope it helps. Cheerio
--
Creator


"Shaun" wrote:

Appreciate advice in advance..

I have set calendar dates equating to a Reporting Month ie

01/01/06 - 31/01/06 = M01
01/02/06 - 28/02/06 = M02

now if I have a cell that relates to when a contract closes (eg 15/01/06)
how can I set the formula in next cell to equal the "M01"

Will need to run this out for the whole year, so not sure I can build that
many < nested IF functions

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default Using IF function with Dates as parameters

Assume your date is in A2, add this formula to B2:

=MONTH(A2)

Click on the cell then Format | Cell | Number (tab) then Custom and
enter "MO"0 and click OK. You can copy this down for as many dates as
you have in column A.

Hope this helps.

Pete

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default Using IF function with Dates as parameters

Sorry, I misread your posting. Same formula, just custom format with
"M"00.

Alternatively, you could have this formula in B2:

="M"&TEXT(MONTH(A2),"00")

and copy down.

Hope this helps further.

Pete

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Using IF function with Dates as parameters


...or even..

=TEXT(A2,"\Mmm")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=511917

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
IF function to blank without getting #value in sum function Brad Stevenson Excel Worksheet Functions 5 May 26th 05 10:26 AM
Finding dates within a date range Marcus Excel Worksheet Functions 2 April 5th 05 02:03 AM
Finding Dates in a date range Marcus Excel Discussion (Misc queries) 1 April 5th 05 01:51 AM
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 01:43 AM.

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

About Us

"It's about Microsoft Excel"