+ Reply to Thread
Results 1 to 8 of 8

Counting based on other cells

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Counting based on other cells

    I'm trying to use excel to count how many cells within a specified range are blank, based on whether a different range matches a third range. Example below:

    1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5
    75 p143 4 234 x43 4 43 332 1 1 1 1 43 5 23 33

    Above is my data


    1 2 3 4 5
    I want then for excel to count how many cells in row 2 are not blank, when row 1 is equal to 1, 2, 3, 4, 5, etc.

    Thoughts??

  2. #2
    Registered User
    Join Date
    06-01-2012
    Location
    New Orleans, US
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Counting based on other cells

    Will row one contain any blanks?

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Counting based on other cells

    It is difficult to determine what your layout is in the thread. Please attach a file that shows your current structure and what your expected results are. Click on Go Advanced to upload a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Counting based on other cells

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    07-30-2012
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Counting based on other cells

    According to your user info, you are using XL2007 so you can use the COUNTIFS formula as such

    =COUNTIFS(1:1,A4,2:2,"<>")
    where A4 is the number you are looking up, (i.e. 1, 2, 3, etc.)

  6. #6
    Registered User
    Join Date
    11-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting based on other cells

    Example Data.xlsx

    Attached should be example information.

    Row 1 will always contain information
    Row 2 will contain some numerical only cells and some text/number cells

    I want a formula that will return the results that are in row 5

  7. #7
    Registered User
    Join Date
    11-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting based on other cells

    Biocidej, your solution works. Can you explain the phrasing? I don't understand how there are 4 arguments in the formula....

  8. #8
    Registered User
    Join Date
    07-30-2012
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Counting based on other cells

    Sure, COUNTIFS is similar to COUNTIF, however, it allows for multiple criteria (up to 127 different range/criteria pairs)

    according to the help file..
    COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
    criteria_range1 = 1:1 (the first row)
    criteria1 = A4 (the number you are looking for in the first row)
    criteria_range2 = 2:2 (the second row)
    criteria2 = "<>" (this is the notation in countif for non-blanks)

+ 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