+ Reply to Thread
Results 1 to 17 of 17

Taking 3 dates and solving for a yes no value

  1. #1
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Taking 3 dates and solving for a yes no value

    I appreciate the help from my last question, hope this one will be just as simple for you excel guru's.

    My issue this time is I want them to input 3 dates.

    A1 DATE1
    B1 DATE2
    C1 DATE3

    Need to figure out if DATE1 is within 120 days before or after DATE3 AND also must be prior to or same as DATE2 to say yes

    if DATE1is not within 120 days from DATE3 OR its not before DATE2 will say no.

    I may have my formatting wrong on my DATE lines, i have them manually input the date like this = 01/20/2010

    It would be nice if i could have them just type in 012010 and it will add the / for them and or extend the 10 to 2010, but my main concern is the formula first and formost. if they have to enter it themselves thats fine.

    My concern is that with a formula i got yesterday, i don't think its calculating the dates when i go back past a year, cause from todays date 120 days would go back to december of 09..and i was gettin mixed results. Any light on the subject would be appreciated. Or if i need to re-explain this situation, plz ask.

    Sorry for the weird request.

    any takers? thanks in advance.
    Last edited by NBVC; 04-14-2010 at 02:20 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    Better to enter the actual date..., if not, you would have to have the result dates formatted as you want in other cells.. or use VBA to convert...

    Try:

    =IF(AND(ABS(C1-A1)<=120,A1<B1),"YES","NO")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Taking 3 dates and solving for a yes no value

    The thing to know abou dates is that they are just numbers. 1 is 1Jan1900, 2 is 2nd Jan 1900 etc today is number 40282.


    =if(and(abs(date1-date3)<=120),date1<date2),"yes","no")


    click on the * Add Reputation if this was useful or entertaining.

  4. #4
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    OK thank you, thats what the other guy gave me too, but just didn't seem right at what i was looking at..ill give this a whirl again until i can tell it breaks, but last question, my awnser cell is giving a yes when everything is 0 and i can't clear it out, is there a way to hide it until all the feilds are entered before it shows yes or no? thanks again

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    Try:


    =IF(COUNT(A1:C1)<>3,"",IF(AND(ABS(C1-A1)<=120,A1<B1),"YES","NO"))

  6. #6
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    ok here is what i got

    =IF(COUNT(G13:G16)<>4,"",IF(AND(ABS(G13-G16)<=120,G14<=G16),"Yes","No"))

    I have 4 dates, just the 3rd date don't mean anything, just there, it don't fit in the formual for anything. but its not calculating right, would you maybe type this in and figure it out?

    I put 04/16/2010 in 1st spot
    02/05/2009 in 2nd this date must be prior to or same day as 4th date
    05/05/2009 in 3rd ( don't mean anything just there to hold it for a min)
    12/16/2009 in 4th, this is the date that needs to be 120 days before or after 1st date

    what ya think? awnser should be yes, but im getting a no....its yes because 4th date is within 120 days of 1st date and 2nd date is before or same as 4th :D

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    The difference between the G13 and G16 dates is actually 121 days...

  8. #8
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    yeah, hah as soon as i sent that i recalculated it, so that should be no...now it seems to be working, for a while it was keeping yes forever and then when it hit no would be no forever, even when i was in yes's..but now it seems to be good..so my bad..thanks so much, i sent it to a hand full of people to see if we can break it..but til then, you guys rock..thanks alot. Ill keep you posted.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    Quote Originally Posted by Argile79 View Post
    yeah, hah as soon as i sent that i recalculated it, so that should be no...now it seems to be working, for a while it was keeping yes forever and then when it hit no would be no forever, even when i was in yes's..but now it seems to be good..so my bad..thanks so much, i sent it to a hand full of people to see if we can break it..but til then, you guys rock..thanks alot. Ill keep you posted.
    Possibly you have your Excel set to not do Auto recalcs?

    Go to Tools|Options and in the Calculation tab.. check Automatic in the Calculation area.

  10. #10
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    It is, thanks...last question...is there a way to format those 4 feilds so they just have to enter 041610 or 04162010 and it will pop in the / for them?

    or would that mess up my final response?

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    As I initially said, not in the same cell.. at least I don't think so. You would have to apply VBA event macro... (I am not sure exactly how).. or you would have another cell contain the result of your formatted date based on those inputs....

  12. #12
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    Ok, thanks..so if i did figure out the macro since those feilds aren't formatted any way, i could try to have it place those in there, but then need something to take them out before the final awnser? like behind the scenes so it don't goof up the formula? Am i understanding that right. I am good with excel, but these more advanced steps and things im tryin to do, just out of my league, but regardless thanks for the assistance so far, great!

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    The macro should actually convert your input to a real date (not just make it look like one) so the formulas would work... or else, the formulas would have to be altered to accomodate.

  14. #14
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    ok, i tried to put in A macro for 1 feild to test it out, BUT when i selected my cell..i just stare at my screen blankly haha. Should be a simple macro..got an idea or should i try looking up macros? Im at work now, so im able to put it into test when i can figure it out. Again i appreciate all this help man

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    My suggestion would be to start a new thread in the programming forum specifically asking for a macro to do this conversion in the same cell as entered automatically. I am sure you will get a relatively quick reply

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Taking 3 dates and solving for a yes no value

    Here might be a macro that may help:

    http://www.cpearson.com/excel/DateTimeEntry.htm

  17. #17
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Taking 3 dates and solving for a yes no value

    Thanks buddy..you rock..out

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1