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 Need help with formulae comparing date-based numbers

I'm trying to write a Excel formula that enters an integer value for a cell,
the value representing an age in days. To get this value, I'm comparing
values in two cells. One cell may or may not have a value, but it establishes
the upper limit for the integer value.
The problem is this: I have tried using both the IF and DATEDIF functions,
and neither returns an integer value. Both give me date values, such as:
4/29/1900. (Kudos to the programmer who sent my data aging in reverse;
perhaps Einstein could learn something from this relativity.) The syntax in
my formulas (below) has no defect that I'm aware of. Someone enlighten me.
=DATEDIF(G4,TODAY(),"d")
=IF(J4F4,F4,J4)
F4 is a cell with an integer value, like 120
J4 calculates an integer using DAYS360. (I have also used it in combination
with an IF, and get the same result)
G4 holds a manually entered date value such as 5/1/ 2009
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default Need help with formulae comparing date-based numbers

Check the format of the cell that contains this formula =IF(J4F4,F4,J4)
If it is set to general you get your integer value, If it is set to date you
get 29/04/1900

"Dataslinger" wrote:

I'm trying to write a Excel formula that enters an integer value for a cell,
the value representing an age in days. To get this value, I'm comparing
values in two cells. One cell may or may not have a value, but it establishes
the upper limit for the integer value.
The problem is this: I have tried using both the IF and DATEDIF functions,
and neither returns an integer value. Both give me date values, such as:
4/29/1900. (Kudos to the programmer who sent my data aging in reverse;
perhaps Einstein could learn something from this relativity.) The syntax in
my formulas (below) has no defect that I'm aware of. Someone enlighten me.
=DATEDIF(G4,TODAY(),"d")
=IF(J4F4,F4,J4)
F4 is a cell with an integer value, like 120
J4 calculates an integer using DAYS360. (I have also used it in combination
with an IF, and get the same result)
G4 holds a manually entered date value such as 5/1/ 2009

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Need help with formulae comparing date-based numbers

Both give me date values, such as: 4/29/1900.

Change the cell format to General or Number and you'll get the integer 120.

--
Biff
Microsoft Excel MVP


"Dataslinger" wrote in message
...
I'm trying to write a Excel formula that enters an integer value for a
cell,
the value representing an age in days. To get this value, I'm comparing
values in two cells. One cell may or may not have a value, but it
establishes
the upper limit for the integer value.
The problem is this: I have tried using both the IF and DATEDIF functions,
and neither returns an integer value. Both give me date values, such as:
4/29/1900. (Kudos to the programmer who sent my data aging in reverse;
perhaps Einstein could learn something from this relativity.) The syntax
in
my formulas (below) has no defect that I'm aware of. Someone enlighten me.
=DATEDIF(G4,TODAY(),"d")
=IF(J4F4,F4,J4)
F4 is a cell with an integer value, like 120
J4 calculates an integer using DAYS360. (I have also used it in
combination
with an IF, and get the same result)
G4 holds a manually entered date value such as 5/1/ 2009



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
Return Corresponding Value Based on Comparing Two Sheets of Data PaulQ Excel Worksheet Functions 6 March 12th 10 05:23 PM
Adding numbers based on date Dyanna Excel Worksheet Functions 2 August 27th 08 06:38 PM
Formula for comparing a date to today's date Sellem Excel Worksheet Functions 4 October 5th 06 01:38 PM
checking and comparing formulae princecharlie Excel Discussion (Misc queries) 6 September 13th 06 06:25 PM
students grades, formulae to calculate what grade is needed based. mjreisbord Excel Worksheet Functions 3 September 4th 05 10:00 PM


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