+ Reply to Thread
Results 1 to 21 of 21

Datevalue

Hybrid View

darchaf Datevalue 10-27-2012, 11:46 PM
jeffreybrown Re: Datevalue 10-27-2012, 11:52 PM
FDibbins Re: Datevalue 10-27-2012, 11:54 PM
darchaf Re: Datevalue 10-27-2012, 11:59 PM
darchaf Re: Datevalue 10-27-2012, 11:56 PM
jeffreybrown Re: Datevalue 10-28-2012, 12:02 AM
darchaf Re: Datevalue 10-28-2012, 12:06 AM
FDibbins Re: Datevalue 10-28-2012, 12:07 AM
darchaf Re: Datevalue 10-28-2012, 12:09 AM
FDibbins Re: Datevalue 10-28-2012, 12:15 AM
darchaf Re: Datevalue 10-28-2012, 12:18 AM
FDibbins Re: Datevalue 10-28-2012, 12:19 AM
darchaf Re: Datevalue 10-28-2012, 12:27 AM
FDibbins Re: Datevalue 10-28-2012, 12:47 AM
darchaf Re: Datevalue 10-28-2012, 01:21 AM
darchaf Re: Datevalue 10-28-2012, 09:11 AM
oeldere Re: Datevalue 10-28-2012, 05:05 AM
darchaf Re: Datevalue 10-28-2012, 08:40 AM
darchaf Re: Datevalue 10-28-2012, 08:44 AM
jeffreybrown Re: Datevalue 10-28-2012, 09:19 AM
FDibbins Re: Datevalue 10-28-2012, 02:12 PM
  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Datevalue

    Hey was wondering if it would be possible to do the following:

    Take this formula:
    PHP Code: 
    =IF(NOW()<=DATEVALUE("9/12/2012"),"",IF(A!E9=TRUE,"P","N")) 
    and make it so the DATEVALUE day (in this case 12) came from another cell

    Ex) a formula that looked like this:

    PHP Code: 
    =IF(NOW()<=DATEVALUE("9/=e7/2012"),"",IF(A!E9=TRUE,"P","N")) 
    where =e7 registered in the formula as being 12... is there anyway to do this?

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Datevalue

    Give this a try

    DATE(2012,9,DAY(E7))
    HTH
    Regards, Jeff

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    try using indirect()

    (im working on the syntax)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    Quote Originally Posted by FDibbins View Post
    try using indirect()

    (im working on the syntax)
    how do I use indirect?

  5. #5
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    Kind of works but not properly in the formula. In the first formula I need a DATEVALUE command otherwise it doesn't work properly

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Datevalue

    What is this?

    A!E9=TRUE

  7. #7
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    It refers to cell E9 on worksheet A. If cell E9 says TRUE then it'll post a P if it says FALSE it'll post an N... cell E9 is linked to a checkbox hence the True n false

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    sorry, use this...
    =IF(NOW()<=DATEVALUE("9/"&E7&"/2012"),"",IF(Sheet2!E9=TRUE,"P","N"))

  9. #9
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    Quote Originally Posted by FDibbins View Post
    sorry, use this...
    =IF(NOW()<=DATEVALUE("9/"&E7&"/2012"),"",IF(Sheet2!E9=TRUE,"P","N"))
    Excel tells me there's an error in the value

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    i had to change your sheet name. change it back to A

  11. #11
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    i did lol thats when it gives me that error

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    it worked for me. upload a sample workbook please

  13. #13
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    here's a quick sample
    Attached Files Attached Files

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    aahh you didnt mention that the "12" was already in date format. try this...

    =IF(NOW()<=DATEVALUE("9/"&DAY(E7)&"/2012"),"",IF(A!E8=TRUE,"P","N"))

  15. #15
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    that works great for the days! One last thing on this topic; is there any way to hook it up so it also picks the months and the years off of seperate cells? (months from E6 and years from E5)?

  16. #16
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    Alright I got a complete fix that works great :
    PHP Code: 
    =IF(NOW()<=DATEVALUE(D6&"/"&DAY(D7)&""),"",IF(A!D8=TRUE,"P","N")) 
    Thanks to everyone who helped

  17. #17
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Datevalue

    Try this one.

    =IF(NOW()<=DATEVALUE(&month(e6)&"/"&DAY(E7)&"/"&year(e5),"",IF(A!E8=TRUE,"P","N"))
    I noticed you used merged cells. I advice you not to work with that; it get you in trouble sooner or later.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  18. #18
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    @ oeldere

    I noticed you used merged cells. I advice you not to work with that; it get you in trouble sooner or later.[/QUOTE]


    Your formula works for reading the month and year however it screws up the DATEVALUE command (it's supposed to display nothing if it's before that date, and instead it displays an N)
    Last edited by Cutter; 10-28-2012 at 01:02 PM. Reason: Removed whole post quote

  19. #19
    Registered User
    Join Date
    10-26-2012
    Location
    welland, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Datevalue

    PHP Code: 
    =IF(NOW()<=DATEVALUE(""&MONTH($D$6)&"/"&DAY($D$7)&"/"&YEAR($D$5)&""),"",IF(A!D8=TRUE,"P","N")) 
    This is the formula I was using since yours also contained several mistakes

    When I tested out the formula (by removing the month command and replacing it with a number), it worked. Looks like it is the MONTH command that isn't working properly...
    Last edited by darchaf; 10-28-2012 at 08:46 AM.

  20. #20
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Datevalue

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  21. #21
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Datevalue

    do it the same way, but use year() and month()

+ 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