+ Reply to Thread
Results 1 to 5 of 5

Calculate Totals Based on Age Restrictions & Years of Service

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Calculate Totals Based on Age Restrictions & Years of Service

    Hello all -

    I am reaching out for some more expertise...

    Per the attached, I am looking to add restrictions to my formula based on YEARS OF SERVICE per the age restrictions each person falls into, those with 0-4 YOS who are under 20 years old etc. etc.

    Your help is much appreciated! THANKS.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    191

    Re: Calculate Totals Based on Age Restrictions & Years of Service

    Hi,

    In your example, this would count how many are under 20 years of age and have 0-4 years of service...

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This would count how many are 20-29 years of age and have 5-9 years of service....

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula needs to be adjusted accordingly for each box.

    I think this is what you mean, I have no idea if it's the most efficient way of doing it, but if I have understood you correctly then it does the job.

    I have re-attached your example.

    Is this any good for you?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Calculate Totals Based on Age Restrictions & Years of Service

    Wow - you are awesome! Quite complicated, but yes it works!

    Just out of curiosity, what does the two (--) after the "sumproduct" accomplish?

    I tried applying your formulas with some modifications to another table involving gender. Do you mind having a quick look at the attached and seeing where I am making the mistakes? I am getting numbers that are quite high and which I know are wrong...

    Jeff
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    191

    Re: Calculate Totals Based on Age Restrictions & Years of Service

    You are welcome

    The 2 -- make it return a count of the values that comply with the conditions as a pose to the sum of them.

  5. #5
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    191

    Re: Calculate Totals Based on Age Restrictions & Years of Service

    The problem is to do with your use of equal to & greater/less than...


    First problem.........

    Your first column is entitled "<20", and your next column "20-29". This suggests that the first column is for people under 20 years, not including 20 years of age.

    So you want to say <20 in your formula, not =<20

    < means less than

    =< means less than or equal to

    You had =<20 in the first column, and =>20 in the second column, so both the first & second columns were counting people who are age 20.


    Second problem...........

    For the gender you were referring to =>"M", or =>"F", and so it probably considered the ones marked "M" to be greater than the ones marked "F", and so counted both for the females.

    You just want to say ="M" & ="F" for this part.



    I have reattached your example with these amendments made. Please let me know if this seems ok now.

    Regards,
    Attached Files Attached Files

+ 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. Replies: 3
    Last Post: 10-29-2013, 04:49 PM
  2. [SOLVED] Calculate years of service.
    By sparrow1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-19-2013, 10:21 AM
  3. Need a vba code to check the status and based on rules calculate service years
    By baba_excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-19-2012, 09:03 PM
  4. Calculate years of service
    By Kimston in forum Excel General
    Replies: 12
    Last Post: 12-16-2012, 12:44 AM
  5. Calculate Years of Service
    By Jerry in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-23-2005, 09:06 PM

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