Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using System Date


Hello,

I have this spreadsheet with columns, say A,B , Date and Grade. On th
last column, I have a date entered.

I do some desicion making, and enter my decision on the grade colum
based on a comparisson, of all the columns and the difference bettwee
the system date, and the date column eg

If A2 and B5 and date 3 Then
grade="Good"
Else If A2 and B5 and Date<3 Then
Grade="Bad"

Else grade ="Unknown"

The " date <3" implies that the system date is say 26th Sept 2005 an
the entry on the date column is say14th Aug 2004, then date <3 sinc
the two dates are less than 3 yrs apart.

How do I code that logic?

Thank

--
oscarook
-----------------------------------------------------------------------
oscarooko's Profile: http://www.excelforum.com/member.php...fo&userid=2811
View this thread: http://www.excelforum.com/showthread.php?threadid=47943

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Using System Date

NbYears=year(SystemDate) - year(DateInColumn)

it will give you the number of years and then you can see if < or 3

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using System Date

I am not sure it is a simple as that:

? Year(DateValue("Jan 1, 2005")) - year(dateValue("Dec 31, 2004"))
1

But I guess it depends on how the OP defines the difference.

--
Regards,
Tom Ogilvy


"tiah" wrote in message
ups.com...
NbYears=year(SystemDate) - year(DateInColumn)

it will give you the number of years and then you can see if < or 3



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Using System Date

ok, i see ! :)

so then make the difference directly :

? round ( ( datevalue("2005-01-01") - DateValue("2004-12-31") )/365.25
,0)


it gives you a number of days, then /365.25 gives you into years
the round makes it no decimals

does it makes sense now ? :)

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
Convert military date system to standard date system John Weaver Excel Discussion (Misc queries) 8 September 17th 09 06:12 PM
Difference betwen Excel Date () Function and System Date Khalil[_2_] Excel Worksheet Functions 2 June 16th 09 01:10 PM
Difference System date and Excel Date function Khalil Excel Worksheet Functions 2 June 16th 09 11:23 AM
date system The Rook[_2_] Excel Discussion (Misc queries) 1 March 15th 07 12:04 PM
Getting system date oscarooko[_7_] Excel Programming 1 October 26th 05 05:15 PM


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