+ Reply to Thread
Results 1 to 3 of 3

Thread: Conditional Formatting - Formula gives #REF!

  1. #1
    Registered User
    Join Date
    03-21-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel: Mac 2008
    Posts
    2

    Conditional Formatting - Formula gives #REF!

    I've written a conditional formatting formula as follows:

    =(AND(B4="",A4<>""))

    I copy and paste the formula into adjacent columns, and, as I always want the formula to check if the contents of column A are blank, I manually change the formula to reference A4. So, I end up with formulas as follow:

    =(AND(B4="",A4<>""))
    =(AND(C4="",A4<>""))
    =(AND(D4="",A4<>""))
    etc...

    Everything works the way I want, and I save my work. However, when I re-open the document later on, all of my A4 values have changed to #REF!, so that my formulas now as follow:

    =(AND(B4="",#REF!<>""))
    =(AND(C4="",#REF!<>""))
    =(AND(D4="",#REF!<>""))

    Why is Excel taking it upon itself to change some of my values into #REF!? How can I fix this? It's driving me crazy...
    Last edited by VBA Noob; 03-21-2009 at 11:53 AM.

  2. #2
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,055

    Re: Conditional Formatting - Formula gives #REF!

    You shouldn't need to adjust the formula for different columns, try selecting the whole range first and then applying the formula that applies to the top left cell, with a $ in front of A4 to stop it changing from column to column, e.g.

    =AND(B4="",$A4<>"")

    Now you've finished, nothing to copy or adjust......

  3. #3
    Registered User
    Join Date
    03-21-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel: Mac 2008
    Posts
    2

    Re: Conditional Formatting - Formula gives #REF!

    Thanks for the quick reply.... worked like a charm! I'm glad I posted here, instead of just banging my head against the wall

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0