+ Reply to Thread
Results 1 to 5 of 5

Copy COUNTIF formula vertically with changing horizontal column references

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    Kampala, Uganda
    MS-Off Ver
    2010
    Posts
    2

    Copy COUNTIF formula vertically with changing horizontal column references

    Hi Guys,
    Working on a dashboard and I have a couple of formulas that works on a couple of drug items, I would love to count some varriables "Yes", "No" e.t.c. For example "=COUNTIF('Raw data template'!AP:AP,"YES")" this counts from the old sheet to the new sheet in cell B4. I have in the meantime manually incremented column references like this.
    B4=COUNTIF('Raw data template'!AP:AP,"YES")"
    B5=COUNTIF('Raw data template'!AQ:AQ,"YES")"
    B6=COUNTIF('Raw data template'!AR:AR,"YES")"
    B7=COUNTIF('Raw data template'!AS:AS,"YES")"
    B8=COUNTIF('Raw data template'!AT:AT,"YES")"..........up to column BK

    I Looked up the function offset but I have not got it working like below (the number of rows to be counted for each item is not fixed it might grow)

    =COUNTIF(OFFSET('Raw data template'!AP$2, 0, ROW() +1, 15), "YES").

    Any help will be greatly appreciated.

  2. #2
    Registered User
    Join Date
    05-30-2014
    Posts
    9

    Re: Copy COUNTIF formula vertically with changing horizontal column references

    use the dollar sign "$ after the AP

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Copy COUNTIF formula vertically with changing horizontal column references

    Try this in B4,then drag down.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Copy COUNTIF formula vertically with changing horizontal column references

    I personally prefer to use INDEX in these types of situations, rather than the volatile INDIRECT or OFFSET:

    =COUNTIF(INDEX('Raw data template'!AP:XFD,,ROWS($1:1)),"YES")

    and copy down.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    08-05-2014
    Location
    Kampala, Uganda
    MS-Off Ver
    2010
    Posts
    2

    Re: Copy COUNTIF formula vertically with changing horizontal column references

    Worked perfect thanks a bunch

+ 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: 0
    Last Post: 11-27-2012, 10:32 AM
  2. Replies: 9
    Last Post: 10-11-2012, 07:50 AM
  3. Changing Horizontal to vertical references
    By Seriously in forum Excel General
    Replies: 5
    Last Post: 07-21-2010, 01:24 PM
  4. changing horizontal data to be shown vertically
    By Frogger0102 in forum Excel General
    Replies: 2
    Last Post: 02-17-2010, 01:13 PM
  5. Copy a formula while changing column references
    By sauron3000 in forum Excel General
    Replies: 2
    Last Post: 06-24-2008, 09:34 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