+ Reply to Thread
Results 1 to 7 of 7

Need to count up every n cells

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Need to count up every n cells

    I am looking to create a function that will count up every nth cell horizontally for a lookup table I have but my brain just isn't clicking on how to do it.

    ie:
    1 0 0 2 0 0 3 0 0 4

    I have been searching on this and am wondering if MOD or OFFSET or Countif based on position of first cell would work? I am at a loss, any clues to point me in the right direction would be amazing.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Need to count up every n cells

    exactly what are you looking to count? In other words, simply those cells that don't have a 0 in them you could simply use a countif like =COUNTIF(A3:J3,">"&0)
    But I suspect there is more to your request.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to count up every n cells

    Quote Originally Posted by Sambo kid View Post
    exactly what are you looking to count? In other words, simply those cells that don't have a 0 in them you could simply use a countif like =COUNTIF(A3:J3,">"&0)
    But I suspect there is more to your request.
    You suspected correct, I was worried I didn't explain it well. What I really want to do is enter a 2 into a cell and have a function count up consecutively every 2 cells. So it would generate 1,0,2,0,3,0,4 or if I put a three in it it would generate 1,0,0,2,0,0,3,0,0,4 across cells horizontally. Does that make sense?

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Need to count up every n cells

    so you are looking for a formula to populate a row of cells depending on the particular value in another cell, not count every Nth cell as the title suggests right?

  5. #5
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to count up every n cells

    Quote Originally Posted by Sambo kid View Post
    so you are looking for a formula to populate a row of cells depending on the particular value in another cell, not count every Nth cell as the title suggests right?
    Yeah, that is a better way to explain it. That is why I put count UP in the title, because I want it to count up by 1 in every nth cell. Essentially a formula to recreate what I had in the inserted table.

  6. #6
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to count up every n cells

    Im getting closer, I can feel it. =IF(MOD(ROW(),$C$1),"N","Y")

    That gives me a Y every nth (in this case, ive populated C1 with a 3) so if I copy this formula down on A1 to A50, I get below:
    N
    N
    Y
    N
    N
    Y
    N
    N
    Y

    Now how would I replace those Y's with cells that count up by one each time the if statement is FALSE?

  7. #7
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to count up every n cells

    OK, I really went on a journey there. It turns out that after 2 days of bashing my head against a wall has unstuck some part of me that could figure this out. In case anyone cares, =IF(MOD(COLUMN(),$A$4),0,(COLUMN())/$A$4) works where starting at A1, if I copy this formula to the right 50 cells and reference A4 which has a number in it (my nth), it will count up each nth by 1. So it would look like this: 0,0,1,0,0,2,0,0,3,0,0,4,0,0,5 etc...

+ 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. Replies: 1
    Last Post: 05-19-2017, 07:37 AM
  2. Count if: Compare 2 ranges and count where cells in same row differ
    By ExcelFed in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2014, 02:34 PM
  3. [SOLVED] Count formula not count hidden cells in table
    By tlacloche in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2013, 02:35 PM
  4. [SOLVED] Formula needed to only count total cells entered and not count adjacent text entered cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-07-2013, 06:22 PM
  5. [SOLVED] count cells that contain text but do not count cells containing only a formula
    By cprpacific in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-13-2013, 03:15 PM
  6. [SOLVED] Count in a range, where identical adjacent cells count as one instance.
    By the-algebraist in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-05-2013, 11:18 AM
  7. [SOLVED] count occupied cells, but put count total in different worksheet
    By NewbieOfVBA in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2012, 07:30 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