+ Reply to Thread
Results 1 to 4 of 4

Convert dates into month (numerical) based on condition

  1. #1
    Registered User
    Join Date
    03-03-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    8

    Convert dates into month (numerical) based on condition

    Hi everyone,

    i need help in excel formula to compute my company's staffs leave entitlement when staff has tendered their resignation.
    For eg, staff resign date is 28/3/2014, excel will count it as 3 months, and if staff resign date is 5/3/2014, excel will count it as 2 months instead.

    The condition is if staff works less than or equal to 15 days of the month, excel will not count that month as a full month but
    if staff works more than 15 days of the month, excel will count the month as a full month.

    Would appreciate if someone can help me out.
    Thanks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,923

    Re: Convert dates into month (numerical) based on condition

    Assume resignation date is in B1. Jan1-2014 is in A1.

    =DATEDIF(A1,B1,"M")+(IF(DAY(B1)<=15,0,1))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,247

    Re: Convert dates into month (numerical) based on condition

    Will count it as two or three months from when exactly?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Convert dates into month (numerical) based on condition

    Assuming staff resign date is in A1, then may be this....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Convert number into Dates (End of Month)
    By acsishere in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-14-2013, 02:17 AM
  2. Count the occurrences of dates in a month against a condition
    By cicilyantony in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2013, 01:26 AM
  3. Convert string dates to proper numerical date format
    By Codpops in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-21-2008, 01:01 PM
  4. How do I format cells from numerical dates to text month in a dif.
    By johntokay in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-11-2005, 05:06 PM
  5. Sql query(convert dates to month names)
    By poppy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-20-2005, 04:54 AM

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