+ Reply to Thread
Results 1 to 4 of 4

Problem with counting item in adjacent cell if the cell in a particular column is empty

  1. #1
    Registered User
    Join Date
    10-22-2021
    Location
    Taipei
    MS-Off Ver
    Office 365
    Posts
    2

    Problem with counting item in adjacent cell if the cell in a particular column is empty

    Good day everyone!

    I am currently faced with the problem of not being able to count items in an adjacent cell if the cell in a particular column is empty.

    I have submitted a sample file for anyone to take a look.

    So basically, the main column I want to count is column B. So for example, I want to count the number of "A" in column B, and if a cell in column B is empty, say if cell B5 is empty, I'd go to cell A5 to see if the data in that cell is "A", and if it is, I'd add it to my tally.

    I have tried using
    Please Login or Register  to view this content.
    to do the job but it doesn't seem to work and I have no idea why!

    It'd be great if anyone could help me out on this!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,492

    Re: Problem with counting item in adjacent cell if the cell in a particular column is empt

    Welcome to the forum.

    First, remove ALL mocked up data from E6 to F8.

    In E6:

    =UNIQUE(FILTER(B2:B11,B2:B11<>""))

    In F6 copied down:

    =IF(E6="","",COUNTIF($A$2:$A$11,E6))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-22-2021
    Location
    Taipei
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Problem with counting item in adjacent cell if the cell in a particular column is empt

    Dear AliGW,

    Thank you so much for your help, it really means a lot to me! I got the result I intended!

    I'll take some time and look into the formula as I have not used UNIQUE and FILTER before!

    Thanks again!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,492

    Re: Problem with counting item in adjacent cell if the cell in a particular column is empt

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. [SOLVED] Fill a column with a formula up to an empty adjacent cell
    By dburge07 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2021, 02:31 PM
  2. Replies: 3
    Last Post: 07-30-2020, 06:02 PM
  3. [SOLVED] Automatically lookup and set an empty cell's value if adjacent cell is typed & vice versa
    By RedSummer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2015, 12:16 PM
  4. Replies: 2
    Last Post: 08-01-2013, 10:27 PM
  5. [SOLVED] Macro to find the empty cell in a column and copy a adjacent row to another column.
    By naga in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2013, 07:44 AM
  6. Replies: 5
    Last Post: 05-17-2012, 10:51 PM
  7. Replies: 1
    Last Post: 02-06-2008, 08:23 AM

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