+ Reply to Thread
Results 1 to 8 of 8

countif-sumif combination??

  1. #1
    Registered User
    Join Date
    04-13-2011
    Location
    louisiana
    MS-Off Ver
    Excel 2003
    Posts
    10

    countif-sumif combination??

    I want to count how many cells in the OS cloumn have a 9 or 10 that also have a 1 in LOS column and compare that to the 9 or 10 in the OS that have LOS greater than 1 and express those results as a percentage of the total number in each LOS category (also to be noted is there will never be a zero value for any, only a blank if data is not reported). Under the data I have the results I need based on manually calculating from the sample data. In reality I need to do this with 50-200 data entries accumulated monthly so that is why i'm looking for a formula but I do not know what will work.... In the data sample each column is alternated bold. Thanks in advance for any help!

    # LOS OS CR CB
    427 1 9 7 7
    509 3 10 9 9
    512 1 10 10 10
    1228 2 8 8 8
    1107 4 9 10
    918 3 7 8
    1530 1 9 9

    [LOS>1, OS=9 or OS=10] 2 out of 4, 50%
    [LOS=1, OS=9 or OS=10] 3 out of 3, 100%

    I'd like this same analysis for OS, CR & CB all relating back to LOS=1 and LOS>1

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: countif-sumif combination??

    Here you go:

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


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


    Attachment 259058

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: countif-sumif combination??

    See if this is the result you wanted.

    I re-arange the data with an macro.

    I bourought the file of daffodil11 (thanks for that).

    After that I made an pivot table of the data.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    04-13-2011
    Location
    louisiana
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: countif-sumif combination??

    Thank you both for the help, I appreciate it very much!

    I have a follow up problem though....
    I also want to analyze the OS, CR & CB by #. The # column is a specific area in a more general region. The refions are 4-15 and correspond to the first digits of the #. I created a "hidden" column in my formatting that gives the region of each entry and when i adapted the sumproduct formula to get the new results I keep getting a zero return but I know it is not correct. I've attached the actual spread sheet i'm working with as well.
    Attached Files Attached Files

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: countif-sumif combination??

    What value do you want to be in O9? Are you simply attempting to add up the numbers?

    Why are there two ranges instead of one continuous list?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: countif-sumif combination??

    With an pivot table.

    Also notice I changed the formula for the region (in 2 digit format).

    See the attached file.
    Attached Files Attached Files
    Last edited by oeldere; 08-20-2013 at 01:02 PM.

  7. #7
    Registered User
    Join Date
    04-13-2011
    Location
    louisiana
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: countif-sumif combination??

    In O9 I should get a value of 0.8 because there are 5 entries from region 4 and 4 of the 5 have a 9 or 10 result.
    And I need to do the same for every region in the 2 categories of CR and CB.

    I have 2 columns of entries so I just added them together because i don't know how to have a continuous range from 2 columns

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: countif-sumif combination??

    Took a bit, but I found the issue:

    Change F4 to =ABS(if(blahblahblah))

    The LEFT function doesn't output as numbers so your formula which works completely fine can't find the number matches.

    =ABS(IF(LEN(A4)=3,LEFT(A4,1),IF(LEN(A4=4),LEFT(A4,2))))
    And just copy down and around as needed.



    Next, change O9 to:

    =(SUMPRODUCT(($F$4:$F$50=$N9)*(D$4:D$50={9,10}))+SUMPRODUCT(($L$4:$L$50=$N9)*(J$4:J$50={9,10})))/(COUNTIF($F$4:$F$50,$N9)+COUNTIF($L$4:$L$50,$N9))

    and copy over and down as needed.

    Attachment 259338
    Last edited by daffodil11; 08-20-2013 at 02:41 PM. Reason: example

+ 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. Combination of CountIF, IF, and NOT
    By shani20 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-08-2011, 06:58 PM
  2. SUMIF - VLOOKUP Combination
    By Fraser in forum Excel General
    Replies: 7
    Last Post: 10-27-2009, 12:34 PM
  3. Sumif & Sumproduct combination
    By rickyilas in forum Excel General
    Replies: 2
    Last Post: 10-09-2009, 09:30 AM
  4. [SOLVED] COUNTIF COMBINATION??
    By Heather in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2005, 10:06 PM
  5. SUMIF - HLOOKUP Combination
    By Mark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2005, 04: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