+ Reply to Thread
Results 1 to 7 of 7

countif formula changes cell values and cell reference is unchanged

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    countif formula changes cell values and cell reference is unchanged

    Hi all,

    Some times get stuck on basics.. always learning.

    iF i FILL IN FORMULA IN sheet2 B2
    Please Login or Register  to view this content.
    AND DRAG IT DOWN THE CELLS CHANGE
    Please Login or Register  to view this content.
    AND SO ON.

    Secondly when i drag it down the adjacent cell reference is frozen to "a" where as it should change to b , c,, and so on.

    is THERE ANY WAY I CAN DO IT EASILY.

    many thanks

    Kind regards

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: countif formula changes cell values and cell reference is unchanged

    Are you saying that you don't want the cell references to change? If so, you can do this:

    =COUNTIF(Sheet1!A$2:N$20,"a")

    the $ symbol in front of the row reference prevents it from changing when the formula is copied down. You can do a similar thing in front of the column reference if you copy across.

    It might look better if you put a, b, c etc in cells A2, A3, A4 in Sheet2, then your formula in B2 will become:

    =COUNTIF(Sheet1!A$2:N$20,A2)

    When this is copied down the A2 at the end will change to A3, A4 etc. on subsequent rows, so it will be looking for the values that are in those cells.

    Hope this helps.

    Pete

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: countif formula changes cell values and cell reference is unchanged

    edit: after reading again I understood beter, so my changed hint is:

    =COUNTIF(Sheet1!A2:N20,CHAR(ROW(97:97)))

    and copy this down.

    "a" is 97th char in ASCII code
    Last edited by Kaper; 01-24-2014 at 11:27 AM.

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: countif formula changes cell values and cell reference is unchanged

    Hi Pete,
    That's great.
    Spent a lot of time on this.
    But finally it is solved with your help.
    Thanks again. It works great.
    I have clicked * to thank you.
    Kind regards
    KK1234

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: countif formula changes cell values and cell reference is unchanged

    if you want the last bit to change from a thro' z when dragged down
    =COUNTIF(Sheet1!$A$2:$N$20,CHAR(ROW(A97)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: countif formula changes cell values and cell reference is unchanged

    Hi Kaper,
    The formula works fine. Thanks for your kind help.
    I have clicked * to express my gratitude.
    Kind regards

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: countif formula changes cell values and cell reference is unchanged

    Hi martindwilson,
    I agree with you.
    Really thanks for your great help.
    Many solutions for this.
    I have clicked * to thanks you.
    Kind regards
    KK1234

+ 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. COUNTIF formula with reference to cell above
    By pri31 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 08:07 AM
  2. Replies: 0
    Last Post: 06-16-2011, 09:46 AM
  3. COUNTIF formula looking for value in the cell rather than reference to that cell.
    By barksmith in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-20-2009, 09:33 AM
  4. Show values in formula instead of cell reference
    By pnorgate in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-20-2006, 04:31 AM
  5. [SOLVED] How to keep a cell ref in formula unchanged when the ref cell move
    By Clifton Ford in forum Excel General
    Replies: 2
    Last Post: 03-14-2006, 01:10 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