+ Reply to Thread
Results 1 to 3 of 3

Calculate age of items and divide them in age groups

  1. #1
    Registered User
    Join Date
    12-18-2014
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    8

    Calculate age of items and divide them in age groups

    Hello dear members!

    I am facing the following problem:

    I have a set of data in this form for some equipment

    year_of_build -----end_of_product_life
    ----1980----------------1995
    ----1981----------------2012
    ----1981----------------
    ----1982----------------2011
    etc


    the data are about 10000 entries and where there is no date in the end_of_product_life column it means it is still functioning
    I want to calculate for the years 1990 through 2012 how many items were still in service and divide them in age subcategories like

    --------0-5 6-10 11-15 16-20 over_20
    1990
    1991
    1992
    etc

    is there any elegant way to do it?

    what I have done is to calculate in a differrent sheet the age of each item from the relevant year and then do a countif() in a seperate column or sheet

    the function I used is IF(AND(all!$F2<A$1,all!$O2>A$1),A$1-all!$F2," ") which says if the year_of_build is lesser than the year_of_calculation (build 1980, year of calculation 1990) AND year_of_end_of_life is greater than the year_of_calculation (end of life 1995, year of calculation 1990) then give me the age in the form of year_of_calculation - year_of_build (1990-1980) else return empty cell


    Then I can go make another calcualtion and divide them in subcategories with some CountIFS() functions which I also know how to make

    The question again is:

    Can I do this directly in a form of

    --------0-5 6-10 11-15 16-20 over_20
    1990
    1991
    1992
    etc


    Thank you for the time reading this and thank you even more for the time you might spend to solve and answer

    Happy Holidays to everybody
    Markos

  2. #2
    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,499

    Re: Calculate age of items and divide them in age groups

    without getting into the this is greater than that and less than the other with if stmts, I did something similar using a vlookup stmt for ages to fall within age ranges i.e. 15 y.o. in 0-20 age range.
    I first set up a table with the min of each range then the range in another column and this has to be in ascending order, then used a vlookup to my table and instead of FALSE, used TRUE and it returns the values that the ages fall within. Just a thought for you to consider.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    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,499

    Re: Calculate age of items and divide them in age groups

    check the attached to see if it could work for you (adjusted as you need).
    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. How to divide a set of numbers into 2 equal sum groups
    By mdsuhair in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-22-2014, 05:13 PM
  2. How to divide a group of numbers in to 3 groups as equal as possible.
    By herbeey in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-27-2013, 08:10 PM
  3. Divide set of number into three equal sum groups
    By aboelsous in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-13-2013, 03:09 AM
  4. VBA divide table into groups (Excel)
    By zeno1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2012, 11:44 AM
  5. [SOLVED] How do I divide a data set into a specified number of groups
    By jstanley41 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-27-2012, 06:58 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