+ Reply to Thread
Results 1 to 12 of 12

How to count according to every third cell value in a row?

  1. #1
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    How to count according to every third cell value in a row?

    I have a row range, in which I'd like to take into consideration every 3rd cell value in it.
    Every third cell can have the following values: 0, 1 or more and empty (I will set it as _ in the examples below)

    The valid combinations can be as following:
    _
    0,_
    0,0,_
    >0
    0,>0
    0,0,>0
    etc.

    I'd like to have the following outcome:

    When there are 0 or more 0's with a following empty cell - NA
    When there is one >0 - ==> 1
    When there are one or more 0's followed by one >0 cell - # of 0's + 1
    There cannot be more than one >0 cell, and it is always after (0 or more) zeros.

    Examples.
    Remember: I am only interested in the values of C, F and I etc.

    A B C D E F G H I outcome
    x x NA
    x x 0 x x NA
    x x 0 x x 0 x x NA
    x x 20 1
    x x 0 x x 10 2
    x x 0 x x 0 x x 300 3


    I hope that the pattern is clear.
    Again, for each third cell in a row:
    As long as there only empty cells or zeros ==> NA
    When there is one >0 cell and before it 0 or more zeroed cells => Number of zeros + 1

    I can show you many options I tried, but none worked.
    So I'd ask for you assitance.
    Last edited by dushkin; 07-16-2022 at 12:03 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    Do the irrelevant cells contain EITHER an X or a blank???
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    This works for me with Office 365... Will it work for you??

    =IFERROR(AGGREGATE(14,6,{1,2,3}/(INDEX($A4:$I4,,{3,6,9})>0),1),"NA")

    copied down.

    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    Re: How to count according to every third cell value in a row?

    They contain an arbitrary value. They are never blank.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    In the end (I think) my Q was irrelevant... assuming that the approach at Post 3 works for you.

    Did you see the file, attached at Post 3??
    Last edited by Glenn Kennedy; 07-16-2022 at 01:26 PM.

  6. #6
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    Re: How to count according to every third cell value in a row?

    For some reason I get a format error on opening the file...

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    OK for me... what do you mean by a format error???

  8. #8
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    Re: How to count according to every third cell value in a row?

    No , no problem...
    I downoaded the file while I wasn't logged in. So the file contained some html.
    Strange behavior, but ok.
    I now downloaded it and I'll check it. I'll update soon...

  9. #9
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    Re: How to count according to every third cell value in a row?

    Glenn, thank you for your kind support.
    It looks great.
    Would it work also for google spreadsheets?

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    No idea. I don't use Google sheets. If you had wanted it to work in GS... you should have posted it in the "Other platforms" sub-forum... or made it clear that you wanted a GS solution.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  11. #11
    Registered User
    Join Date
    07-16-2022
    Location
    England
    MS-Off Ver
    2019
    Posts
    8

    Re: How to count according to every third cell value in a row?

    Glenn, I need it also for Office.
    I just wondered if you know if it would have work properly for GSheet which I use as well.
    Thank you for you time!

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: How to count according to every third cell value in a row?

    No problem!! Enjoy what's left of the weekend.

+ 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] Count if adjacent cell to count falls within criteria or not
    By mrsak87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2020, 06:01 AM
  2. Stop count if number = Cell and move rest of count to other cell
    By hackertom in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-18-2018, 09:06 AM
  3. [SOLVED] VBA Count Emails in outlook mail box and enter count and oldest email date into excel cell
    By fireguy7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-24-2018, 11:04 AM
  4. [SOLVED] Pivot for Count and count result as percentage of another cell
    By JEA_123 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-22-2015, 07:54 AM
  5. Replies: 2
    Last Post: 05-28-2014, 07:58 PM
  6. [SOLVED] for every line I browse make a count and post this count in a cell (fiouuu)
    By historic777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2013, 06:41 AM
  7. get a count of filtered data , count should be as values in cell.
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2012, 06:31 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