+ Reply to Thread
Results 1 to 3 of 3

Countif based on column header with "unknown" range position

  1. #1
    Registered User
    Join Date
    06-22-2015
    Location
    lisbon
    MS-Off Ver
    windows 8
    Posts
    33

    Countif based on column header with "unknown" range position

    Hi,

    This is for work, I have an header "aaa" or "bbbb", that the user may paste in the wrong position by mistake. In this example I need to count the number of 1's below the header aaa, or bbb. The difficulty here is that, "aaa" might be in column,a, b c etc... so I need something to find the header, and then to count the 1s (in this case below).

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Excel 2016
    Posts
    10,179

    Re: Countif based on column header with "unknown" range position

    With your small sample this will work, but as you extend your data, adjust the parts in red

    =COUNTIF(INDEX($G$5:$H$7,,MATCH($D6,$G$4:$H$4,0)),1)
    Last edited by jeffreybrown; 11-27-2015 at 06:05 PM.
    HTH
    Regards, Jeff

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,958

    Re: Countif based on column header with "unknown" range position

    I should reange the data and after that use a pivot table.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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] "Read" the column header "Element" and perform calculation
    By dwsf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2015, 01:41 AM
  2. [SOLVED] Replace all BLANK cells in column with header title "Balance" to "0"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2014, 09:25 AM
  3. Return Column Header for Cell Range that equals "1"
    By kibbles in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-11-2013, 11:10 AM
  4. Replies: 3
    Last Post: 04-14-2013, 11:53 PM
  5. [SOLVED] Index, Address and CountIF - Finding the "Last" Non Blank Column through named range
    By dluhut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-15-2013, 12:15 PM
  6. COUNTIF column if cell contains both "text1" and "text2"
    By Quuador in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-05-2012, 07:12 AM
  7. Why does =countif(range,"<>""") count empty cells?
    By Ingeniero1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-16-2008, 01:40 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