+ Reply to Thread
Results 1 to 13 of 13

Copy non absolute cell references in conditional formating formula

  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Copy non absolute cell references in conditional formating formula

    Hi

    I have this fairly simple formula which decides whether to shade a cell or not

    =AND($X$1<>"TBD",R3<>"None",AC3="Y")

    This is set in cell R3 and I want to copy it all the way down the cells in the R column. However, when I copy & paste (and copy and paste using paste special, formatting) the R3 and AC3 cell references do not update to match their relevant rows. eg If I highlight cell R26 the conditonal formatting formula still refers to cell R3 and AC3, not R26 & AC26. I'm using Excel 2010 but I don't recall this happening in 2003. Is there soemthing I'm missing, an option setting for example?

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy non absolute cell references in conditional formating formula

    how about using and indirect reference?
    Formatting copying only copies the attributes of the cells not the formulas, try copying fully or try copying the formulas...

    If everything fails the new formula could look something like this

    =AND($x$1<>"TBD",indirect("worksheetname!r"&row(a3))<>"None",indirect("worksheetname!ac"&row(a3))="Y")

    substitute worksheetname with the name of your worksheet, I started at row 3 because you had it there.

    regards,

    RCM
    Last edited by rcm; 12-03-2012 at 11:25 AM. Reason: additional information

  3. #3
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    When you say "copy fully" I take it your mean a simple CTRL C & CTRL P. That makes no difference, the conditional formatiing fomulas do not update. I'll try the formula you suggest instead.

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy non absolute cell references in conditional formating formula

    Dear AndyGW

    I try copying your formula (I copy/pasted it) and it changed the reference rows...

  5. #5
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    Then I have no idea what is going wrong my end. I just tried again and the cells refs do not update. I've uploaded my workbook. Ive stripped out all the data so the cells themselves all report in error but the formatting is still correct. I just tried again and no matter how I copy& paste the cells I paste do not update their conditional formatting refs.

    Thanks for your help.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    As a test I just set up a super simple new workbook and put the conditional formatting formula =AND(a1=1) in the cell A1, then copied it down the A column... none of the cell refs updated beyond saying A2 all the way down. If its a local problem then somehow my excel is porked.

  7. #7
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    Sorry yet more info. I just rechecked that sheet I made an even tho the cells refs don't update the code is working. ie If I set any of the cells to something other than 1 the shading turns off. Am I just reading it wrong? I've just come from xl 2003. This is what I do - I highlight the cell, click the conditional formatting tab which opens up the cond formating dialogue box, then click "manage rules". The rule shows the formula and the cell range it applies to. The range is right but if I view the formula itself, no matter what cell I highlight the formula always reads as A1 or A2.

  8. #8
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy non absolute cell references in conditional formating formula

    You lost me there with your uploaded file... the only formula I could find is a Vlookup with and invalid reference

  9. #9
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    Yes it the conditional formatting formula on the cells Im having a problem with, not the cell formula itself. Check any of the "Raid" column cells and open up the conditional formatting dialogue box.

  10. #10
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy non absolute cell references in conditional formating formula

    Andy:

    I reread your first post. If you set the formula posted there in r3, you get a CIRCULAR REFERENCE error.. in which column are you setting the formula?

  11. #11
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    I dont believe this to be a problem as this is conditional formatting. All conditional formatting is essentially a circuclar reference, eg if cell value = 1 turn red. The format refers to the cell that it is going to change.

  12. #12
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    I've created an example workbook with notes highlighting exactly what the problem is. This may just be an unavoidable glitch but if so, it's annoying as hell.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-03-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Copy non absolute cell references in conditional formating formula

    Any ideas?

    I've reverted back to Excel 2003 for this worksheet for the time being.

+ 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