+ Reply to Thread
Results 1 to 7 of 7

Calculate number/percentage less than x amount based on text in another column

  1. #1
    Registered User
    Join Date
    09-29-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    73

    Calculate number/percentage less than x amount based on text in another column

    Hi there

    I'd like to lookup all cells than match the term 'blue' in column A and calculate what percentage fall below a certain figure (in this example 15 minutes). I would then like to do the same for all other cells in column A exclude 'blue'.

    The sheet attached should explain what I am looking to do.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Calculate number/percentage less than x amount based on text in another column

    the COUNTIFS Function should do what you want...one question....I'm sure what you mean by falling below 15 minutes....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    09-29-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Calculate number/percentage less than x amount based on text in another column

    I couldn't get the COUNTIFS function calculate percentages.

    What I mean by 15 minutes, is that I wanted the calculation to find all Blue times and calculate how many of the Blue times were below 15 minutes. In the example sheet it would 100% because all of the times next to the Blues are below 15 minutes. But for the others (i.e. not Blue) 3 are over 15 minutes so the percentage would be 57% (i.e. 57% were below 15 minutes, 43% over).

    I don't know how to do a COUNTIFS for all options except Blue.

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Calculate number/percentage less than x amount based on text in another column

    okay...gotcha....except that those are not in minutes according to excel....that is actually 2:30 PM in cell B2....click on it and look in the formula bar....and you are correct...COUNTIFS will not give you percent all by itself....it gives you the count so you can do the math....

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Calculate number/percentage less than x amount based on text in another column

    so, I would convert your Time to 14.5 instead of 14:30....easier to do math against and here are formulas...

    =COUNTIFS(A2:A12,"Blue",B2:B12,"<15")/COUNTIF(A2:A12,"Blue") Blue under 15 minutes
    =COUNTIFS(A2:A12,"<>Blue",B2:B12,"<15")/COUNTIF(A2:A12,"<>Blue") NOT Blue under 15 minutes

  6. #6
    Registered User
    Join Date
    09-29-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Calculate number/percentage less than x amount based on text in another column

    First formula worked for me in my real sheet but second didn't. It's ok though as I've done it manually using your first formula. It was the minutes that was incorrect.

    Thanks for your help. Much appreciated.

  7. #7
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Calculate number/percentage less than x amount based on text in another column

    no problem....glad I could help....

+ 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