Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default In XLS, how do IF stmt for IF a date is after another date...?

In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default In XLS, how do IF stmt for IF a date is after another date...?

With Excel dates in A1 and B1 (note: not text items that look like
dates), try this in C1:

=IF(A1B1,"A1 after B1",IF(B1A1,"A1 before B1","same dates"))

Hope this helps.

Pete

On May 3, 4:43 pm, wiggledg
wrote:
In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default In XLS, how do IF stmt for IF a date is after another date...?

And make sure that ToolsOptionsCalculation is set to "Automatic"


Gord Dibben MS Excel MVP

On 3 May 2007 08:54:24 -0700, Pete_UK wrote:

With Excel dates in A1 and B1 (note: not text items that look like
dates), try this in C1:

=IF(A1B1,"A1 after B1",IF(B1A1,"A1 before B1","same dates"))

Hope this helps.

Pete

On May 3, 4:43 pm, wiggledg
wrote:
In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default In XLS, how do IF stmt for IF a date is after another date...?

Thanks, I'm not sure why a date can't be hard coded into the formula, but it
works now that I have the formula targeted to a cell. Thanks again!!!

"Pete_UK" wrote:

With Excel dates in A1 and B1 (note: not text items that look like
dates), try this in C1:

=IF(A1B1,"A1 after B1",IF(B1A1,"A1 before B1","same dates"))

Hope this helps.

Pete

On May 3, 4:43 pm, wiggledg
wrote:
In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default In XLS, how do IF stmt for IF a date is after another date...?

You could use DATEVALUE("1/1/2007") instead of one of the cell
references to hardcode a date in the formula and to allow it to be
understood more easily, but isn't it easier to refer to a cell that
contains the date?

Hope this helps.

Pete

On May 3, 10:26 pm, wiggledg
wrote:
Thanks, I'm not sure why a date can't be hard coded into the formula, but it
works now that I have the formula targeted to a cell. Thanks again!!!



"Pete_UK" wrote:
With Excel dates in A1 and B1 (note: not text items that look like
dates), try this in C1:


=IF(A1B1,"A1 after B1",IF(B1A1,"A1 before B1","same dates"))


Hope this helps.


Pete


On May 3, 4:43 pm, wiggledg
wrote:
In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default In XLS, how do IF stmt for IF a date is after another date...?

I'd use =date() to make sure the date was unambiguous.

=if(date(2007,12,25)a1, ...

(I'm not sure why you'd hardcode both dates in the cell, though.)

wiggledg wrote:

Thanks, I'm not sure why a date can't be hard coded into the formula, but it
works now that I have the formula targeted to a cell. Thanks again!!!

"Pete_UK" wrote:

With Excel dates in A1 and B1 (note: not text items that look like
dates), try this in C1:

=IF(A1B1,"A1 after B1",IF(B1A1,"A1 before B1","same dates"))

Hope this helps.

Pete

On May 3, 4:43 pm, wiggledg
wrote:
In Excel, how can I create an IF statement to return a value or text IF a
DATE is after or before another date? It doesn't seem to recognize dates and
is returning all the same value in the current IF statement I've created.
I'm not sure if it has something to do with formatting but I've changed the
formats to Dates, General, Text, etc and the IF statement still doesn't
work........





--

Dave Peterson
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
Report Date - Date Recv = Days Late, but how to rid completed date MS Questionnairess Excel Worksheet Functions 1 January 24th 07 11:05 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Make date change in excel to current date when opening daily? jamie Excel Discussion (Misc queries) 3 March 1st 06 03:37 PM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM


All times are GMT +1. The time now is 05:06 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"