Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Formula/macro help

In Column "T" I have in text format dates in the following format dd mmm
yyyy. Reason for text format, I sometimes do not have the year. Is it
possible to write a formula in column "V" that if row "XX" and column "T"
are not blank and number of characters are greater than six, the right four
numbers are subtracted from the current year, providing a number of years
value. Or would this require a macro?

--

Regards
Michael Koerner



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Formula/macro help

Michael, Not sure why you want to conditionally look for the character
count 6 (if you were testing for omitted yyyy then you would be
checking for LESS THAN 7 "mm/dd/" the formulae below will give you the
current year value if Column T is blank or has <7 characters..
otherwise will give the value of column T.

=IF(AND(T2<"",len(T2<7),TEXT(NOW(),"yyyy"),T2)

HTH,
Will

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Formula/macro help

Tried your formula, and it was missing a ")" which I found after a couple of
tries (not to familiar with formula). which provided me with half of what I
want. Now that I have the current year I would like to subtract the yyyy
from "T2", giving me the number of years difference. Thanks for taking the
time to help.

--

Regards
Michael Koerner


"Will Cairns" wrote in message
ups.com...
Michael, Not sure why you want to conditionally look for the character
count 6 (if you were testing for omitted yyyy then you would be
checking for LESS THAN 7 "mm/dd/" the formulae below will give you the
current year value if Column T is blank or has <7 characters..
otherwise will give the value of column T.

=IF(AND(T2<"",len(T2<7),TEXT(NOW(),"yyyy"),T2)

HTH,
Will



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Formula/macro help


Put this into the formulae where it's currently stated as
TEXT(NOW(),"yyyy")... however, if T2 is less than 7 characters in
length then there will not be a year value there ??


(TEXT(NOW(),"yyyy")-(TEXT(T2,"yyyy")))


Michael Koerner wrote:
Tried your formula, and it was missing a ")" which I found after a couple of
tries (not to familiar with formula). which provided me with half of what I
want. Now that I have the current year I would like to subtract the yyyy
from "T2", giving me the number of years difference. Thanks for taking the
time to help.

--

Regards
Michael Koerner


"Will Cairns" wrote in message
ups.com...
Michael, Not sure why you want to conditionally look for the character
count 6 (if you were testing for omitted yyyy then you would be
checking for LESS THAN 7 "mm/dd/" the formulae below will give you the
current year value if Column T is blank or has <7 characters..
otherwise will give the value of column T.

=IF(AND(T2<"",len(T2<7),TEXT(NOW(),"yyyy"),T2)

HTH,
Will


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Formula/macro help

Once again, thanks very much for the help. If the T2 is less than 7
characters can the cell be left blank? This what I have now, which works if
there is 7 characters and enters FALSE if there is not 7 characters.

=IF(AND(T25<"",LEN(T25<7)),(TEXT(NOW(),"yyyy")-(TEXT(T25,"yyyy"))))

--

Regards
Michael Koerner


"Will Cairns" wrote in message
oups.com...

Put this into the formulae where it's currently stated as
TEXT(NOW(),"yyyy")... however, if T2 is less than 7 characters in
length then there will not be a year value there ??


(TEXT(NOW(),"yyyy")-(TEXT(T2,"yyyy")))


Michael Koerner wrote:
Tried your formula, and it was missing a ")" which I found after a couple
of
tries (not to familiar with formula). which provided me with half of what
I
want. Now that I have the current year I would like to subtract the yyyy
from "T2", giving me the number of years difference. Thanks for taking
the
time to help.

--

Regards
Michael Koerner


"Will Cairns" wrote in message
ups.com...
Michael, Not sure why you want to conditionally look for the character
count 6 (if you were testing for omitted yyyy then you would be
checking for LESS THAN 7 "mm/dd/" the formulae below will give you the
current year value if Column T is blank or has <7 characters..
otherwise will give the value of column T.

=IF(AND(T2<"",len(T2<7),TEXT(NOW(),"yyyy"),T2)

HTH,
Will




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
Macro Formula for Max value John Bundy Excel Worksheet Functions 0 November 30th 06 05:25 PM
Macro Formula for Max value Gary''s Student Excel Worksheet Functions 0 November 30th 06 05:20 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Using the And formula in a VBA macro Corinne R Excel Programming 5 April 30th 04 11:40 PM
how to add formula to this macro??? mary Excel Programming 0 January 20th 04 02:30 AM


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