+ Reply to Thread
Results 1 to 4 of 4

Formula Correction (concerning dates in excel)

  1. #1
    Registered User
    Join Date
    04-29-2010
    Location
    McLean, VA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    87

    Formula Correction (concerning dates in excel)

    Please see the attached file containing a formula I need help with.

    The formula I need to have corrected concerns dates that are typed into excel and then calculates how many months there are during a particular calendar year given the dates that have been typed in.

    All instructions are listed in the attached sheet. This is a pretty difficult task so if you can figure it out, all the better to you!

    Thanks for any help!
    Attached Files Attached Files
    Last edited by The Exceller; 06-09-2010 at 03:14 PM. Reason: Title Change

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

    Re: For an absolute expert

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    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
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula Correction (concerning dates in excel)

    Two things:

    When using LEFT,RIGHT,MID functions to extract numbers, usually you want to coerce the results (which are text strings) to numbers... so, one way is to add +0 after the function.... then you will be comparing apples to apples.

    Another thing is that Excel has several functions to assist in breaking up dates to the year, month or day components, so better to use them if you can...

    so use,


    =IF(YEAR($G$12)>RIGHT(E28,4)+0,12-G27,MONTH($G$12)-1+$H$2/SUMIF($N$32:$N$45,MONTH($G$12),$O$32:$O$45))

    or, you don't really need the table of months and days/month, you can use instead.

    =IF(YEAR($G$12)>RIGHT(E28,4)+0,12-G27,MONTH($G$12)-1+$H$2/DAY(DATE(YEAR($G$12),MONTH($G$12)+1,0)))

  4. #4
    Registered User
    Join Date
    04-29-2010
    Location
    McLean, VA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    87

    Re: Formula Correction (concerning dates in excel)

    NBVC,

    You are an absolute genius. I can't believe you got that so quickly. I really really appreciate it and this will be more than handy to me. Thanks so much for your help. I learned a lot from you here so thanks a lot. The formulas work perfectly and I'm glad that I won't have to use the table of days/month too.

    Thanks again.
    No wonder you are a "Forum Guru." You're awesome!

+ 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