+ Reply to Thread
Results 1 to 12 of 12

countif function multiple columns moving range

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    countif function multiple columns moving range

    Hi,

    I want to use a countif function, counting values in column 1-9, The next countif function needs to count values in column 10-18 etc..
    As i have 4000 columns to count and don want to key in 450 times the same countif statement (except different columns to count) I wonder if there is an easy way to automate the countif statement so i can key it in once and copy and paste it 449 times.

    Hope someone has an easy solution for me?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: countif function multiple columns moving range

    Paste it how, horizontally or vertically?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    08-23-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: countif function multiple columns moving range

    paste horizontally
    Cell A1 to reflect column A-I
    Cell B1 to reflect column J-R etc..

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: countif function multiple columns moving range

    "Cell A1 to reflect column A-I"
    You'll get circular references if you mean A1:I(row number)
    What row ranges are we talking about?

    You'll get a quicker solution if you supply all the information rather than me having to ask one question at a time.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,648

    Re: countif function multiple columns moving range

    First apply the following formula to A1:
    Please Login or Register  to view this content.
    Copy out to the end of the worksheet by pressing Ctrl+Shift+right arrow and selecting fill right.
    While the cells in row one are still selected:
    Put the following formula in Conditional Formatting:
    Please Login or Register  to view this content.
    Select Format>Font>Color>White
    In the attached file you can see how the formulas and formatting rule are applied.
    Countifs Multiple Columns.xlsx
    Let me know if you haven any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Registered User
    Join Date
    08-23-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: countif function multiple columns moving range

    Above solution is not the solution I am looking for.

    I have 1 worksheet (1) with 4000 columns of data.
    In a separate worksheet (2) I want to put a countif statement in cell A1 counting data in the first 9 columns of worksheet (1). In cell B1 I want to count the data of column 10-18 of worksheet (1). Next in cell C1 of worksheet (2) I want to count the data of column 19-27 of worksheet (1).

    As I will need approx 450 formulas in worksheet (2) to cover all data, 4000 columns of worksheet (1) I would like to state the countif function in such way that I can copy it and paste it 449 times into worksheet (2).

  7. #7
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: countif function multiple columns moving range

    have you tried this?

    Put this in A1 worksheet 2

    =COUNTIF(Sheet1!A1:I1,"your criteria")

    then copy it to next cell, B1,C1 etc.

  8. #8
    Registered User
    Join Date
    08-23-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: countif function multiple columns moving range

    Yes tried that, but that does not work as it only shifts formula from A-I to B-J.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,648

    Re: countif function multiple columns moving range

    Quote Originally Posted by Raspia View Post
    I have 1 worksheet (1) with 4000 columns of data. In a separate worksheet (2) I want to put a countif statement in cell A1 counting data in the first 9 columns of worksheet (1). In cell B1 I want to count the data of column 10-18 of worksheet (1). Next in cell C1 of worksheet (2) I want to count the data of column 19-27 of worksheet (1).
    Pesky little details are useful to know from the outset.
    This solution will require a helper row (which can be hidden) of cells to be placed somewhere on sheet2, I placed it in row 3. The formula that populates the first row is:
    Please Login or Register  to view this content.
    Countifs Multiple Columns.xlsx
    Let me know if you have any questions.

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countif function multiple columns moving range

    You didn't specify what the actual criteria is that you want to count, so I just put "criteria"

    Try
    =COUNTIF(OFFSET($A$2:$I$100,0,(COLUMNS($A:A)-1)*9),"criteria")

    Don't change the $A:A reference, it is not related to your data.

  11. #11
    Registered User
    Join Date
    08-23-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: countif function multiple columns moving range

    Thanks this worked for me!

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,648

    Re: countif function multiple columns moving range

    You're welcome, thank you for the feedback and the reputation. Let me say that Jonmo1's formula is superior to the solution I provided based on not needing a helper row. Since the formula is placed on Sheet2 it will need a slight modification as in:
    Please Login or Register  to view this content.
    I am assuming the criteria that you are looking for is any cell that contains a value. If you are satisfied with the solutions provided please take a moment to mark the thread 'Solved' using the thread tools link above your first post. Hope that you have a good day.

+ 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] Single column countif with moving range based on today's date
    By JonesyCC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2013, 02:45 PM
  2. Dynamic named range for columns...moving one column over
    By amartino44 in forum Excel General
    Replies: 7
    Last Post: 09-13-2013, 02:31 AM
  3. Moving characters in between {} into multiple columns
    By labmanager in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2013, 03:31 PM
  4. [SOLVED] Moving data from two columns into multiple columns
    By blindzero678 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2012, 10:12 PM
  5. [SOLVED] Delete multiple empty cells in multiple columns and moving data up, witout Macros
    By CoraF in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:23 AM
  6. [SOLVED] Copy range from multiple sheets, into a master sheet and moving over by variable col range
    By g1eagle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2012, 01:36 PM
  7. Using MATCH to replace range when moving columns
    By KAPearson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2012, 12:22 PM
  8. Copying and moving multiple columns around
    By Sccye in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2010, 07:03 AM

Tags for this Thread

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