+ Reply to Thread
Results 1 to 7 of 7

How do you get formulas to adjust to new cells?

  1. #1
    Registered User
    Join Date
    09-13-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2003
    Posts
    56

    How do you get formulas to adjust to new cells?

    I have a formula comparing my two schedules (to see if there are any scheduling conflicts).

    =COUNTIF($A$2:$A$83,$I2)

    That's the formula. My question is, when I copy that formula to the next cell (and column) over to compare schedules in A and J, for instance, how do I get the formula to automatically adjust to the next cell over?

    For example, when I copy and paste that formula the normal way, say I copy it, then I highlight the next 20 cells to the right of it to copy it into all of them, what I get is just the same exact formula over and over again in those cells.

    I just get this over and over.

    =COUNTIF($A$2:$A$83,$I2)
    =COUNTIF($A$2:$A$83,$I2)
    =COUNTIF($A$2:$A$83,$I2)
    =COUNTIF($A$2:$A$83,$I2)
    =COUNTIF($A$2:$A$83,$I2)

    When what I want to automatically happen is...

    =COUNTIF($A$2:$A$83,$I2)
    =COUNTIF($A$2:$A$83,$J2)
    =COUNTIF($A$2:$A$83,$K2)
    =COUNTIF($A$2:$A$83,$L2)

    and so on.

    How do I get the last part of the formula, the $I2, to automatically adjust one column over for every column to the right I paste it in, while keeping the A's constant?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: How do you get formulas to adjust to new cells?

    This will probably help to explain it: http://www.cpearson.com/excel/relative.aspx

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    09-13-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: How do you get formulas to adjust to new cells?

    Thanks Dom, but okay, so what do I change exactly? If I take out the $ sign in $I2, i dont think the formula will work at all. Will it? Tell me what exactly to change in my formula and how to do it please so there's no grey area.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: How do you get formulas to adjust to new cells?

    This should do it:

    =COUNTIF($A$2:$A$83,I2)

    The $'s only specify whether your reference is absolute, relative or mixed. They have no bearing on how the actual function calculates.

    Dom

  5. #5
    Registered User
    Join Date
    09-13-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: How do you get formulas to adjust to new cells?

    And what about if the data always in adjacent columns? Like maybe I want my results, where im inputting the formulas, to just be every next column, but when I copy the formula one column to the right, I need the formula to actually adjust two columns in terms of the data, because there's a non-data column between the data.

    As in, what you told me worked for what I described, but.....

    Okay, say I have my schedules in column A, B, and C, and then I use this formula to compare them in the next three columns. Then pasting it from D to E would work. But what if Im pasting it from D to E, but I want the formula to switch from A to C? Like what if instead of 3 schedules in A, B, C, I had one in A, but something else in B, and then again in C?

    What if i need the formula to switch two columns and not just one every time I paste? How do I do that?

  6. #6
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: How do you get formulas to adjust to new cells?

    If your data skips a column, but your formulas are only copied over one column, then you will need to manually adjust your formulas. Autofill cannot predict or read your mind. If you copy your formula one column over, it can adjust your formula for that column shift. But it cannot predict that, in this one case, you want it to actually adjust by two columns.

    You could probably achieve the desired result with an Index/Match combination, and maybe an Indirect or something thrown in, but I would recommend first understanding relative and fixed references before trying to get too complex with your formulas.

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: How do you get formulas to adjust to new cells?

    I suppose present thread is the continuation of this one ?
    http://www.excelforum.com/excel-gene...conflicts.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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