+ Reply to Thread
Results 1 to 9 of 9

Formula Help on Dates

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Formula Help on Dates

    Hello all!

    If anyone can kindly assist me:

    I am using a system generated report that spits out years/months someone has been with the company. I would like to pull this data for my pivot table, but am having trouble with the formula.

    What I am trying to say (results should be in in Column O):

    If N6 = If 0-4 years, then show me the year as a 1,2,3 or 4. Anything in the 0-11 months range should show as 1. If 5-9 years, then show me 5,6,7,8 or 9. etc. based on the following years of service ranges: (which will later be grouped in the pivot table).

    0-4
    5-9
    10-14
    15-19
    20-24
    >25

    I would like to use one spreadsheet moving forward, where I can just plug in the data each month and refresh the tables. I would cap the number of lines in my table at 700. Will this mess anything up if there are blank cells?

    Thanks!!!

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Formula Help on Dates

    Hello,
    you have the hired date in col H. deduct from today to get their tenure for years & months in col O.
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Formula Help on Dates

    See attached:

    Added calculation is Column L and O of "Raw Data"

    IF([@[PERSONAL Birthdate]]="","",DATEDIF([@[PERSONAL Birthdate]],TODAY(),"y"))

    =IF([@[STATUS Most Recent Hire Date]]="","",DATEDIF([@[STATUS Most Recent Hire Date]],TODAY(),"y"))

    in Sheet1

    D17

    =IF([@[STATUS Most Recent Hire Date]]="","",DATEDIF([@[STATUS Most Recent Hire Date]],TODAY(),"y"))

    Copy across to H and down to row 21

    in D22

    =COUNTIFS('RAW DATA'!$O:$O,">=" &Sheet1!$C22,'RAW DATA'!$L:$L,">=" &Sheet1!D$16,'RAW DATA'!$L:$L,"<" &Sheet1!E$16)

    Copy across to H

    in I22

    =COUNTIFS('RAW DATA'!$O:$O,">=" &Sheet1!$C22,'RAW DATA'!$L:$L,">=" &Sheet1!I$16)


    You can use similar formulae for your "Gender" table

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Formula Help on Dates

    Updated file with "Gender" table.

    in D28

    =COUNTIFS('RAW DATA'!$M:$M,"=" &Sheet1!$C28,'RAW DATA'!$L:$L,">=" &Sheet1!D$16,'RAW DATA'!$L:$L,"<" &Sheet1!E$16)

    Copy across to H and Down

    in I28

    =COUNTIFS('RAW DATA'!$M:$M,"="&Sheet1!$C28,'RAW DATA'!$L:$L,">="&Sheet1!I$16)

    copy down

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Formula Help on Dates

    Amazing John! Thank you!

    I see a number of #VALUE errors on my age calculations per the sheet you sent...do you know why / how to resolve?

    Thanks

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Formula Help on Dates

    There are no #VALUE errors in the file I posted.

  7. #7
    Registered User
    Join Date
    05-17-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Formula Help on Dates

    Hmmm - I will re-attach to see if you see the error or not. I also took a screenshot.
    Attached Images Attached Images
    Attached Files Attached Files

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Formula Help on Dates

    you are getting the value issue due to the format of your dates as dd/mm/yyyy instead of mm/dd/yyyy. If you reverse the first one from 27/3/1950 to 3/27/1950 it will clear up.
    how does =today() read in your file? if I put =today() into an empty cell in your sheet it reads 6/14/2018.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Formula Help on Dates

    this formula can change the order of your birth dates
    =MID(Table2[@[PERSONAL Birthdate]],4,2)&"/"&LEFT(Table2[@[PERSONAL Birthdate]],2)&"/"&RIGHT(Table2[@[PERSONAL Birthdate]],4)

+ 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] Formula to return the 'earliest' and 'latest' dates from a list of dates is not working
    By Hawkmoth1 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2017, 07:14 AM
  2. [SOLVED] Require a formula to count unique dates excluding weekend dates
    By john dalton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-09-2015, 09:17 AM
  3. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2014, 07:42 PM
  4. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  5. Replies: 1
    Last Post: 06-14-2014, 02:01 AM
  6. Replies: 11
    Last Post: 05-04-2014, 08:28 PM
  7. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 AM

Tags for this Thread

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