+ Reply to Thread
Results 1 to 11 of 11

Conditional Fornat rule referencing another sheet?

  1. #1
    Registered User
    Join Date
    05-02-2011
    Location
    Australia
    MS-Off Ver
    Excel 2019
    Posts
    57

    Question Conditional Fornat rule referencing another sheet?

    Hello,

    Was trying to create a conditional format rule that referenced values on another sheet of the workbook. Seems (at least) Excel 2016 conditional format rules recognise cell references on other sheets. Is there a workaround for this?

    Regards

    I-Like-Excel

    EDIT: Ignore the second and third sentence. I was entering in teh formula rule wrongly and it was being "converted" to a text string instead (enclosed by ' '). Refer to sample file in post below.
    Last edited by I-Like-Excel; 05-03-2023 at 08:31 AM.

  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,825

    Re: Conditional Fornat rule referencing another sheet?

    In older versions of Excel you can not directly reference cells or ranges in other sheets in a Conditional Formatting expression (I'm not sure about XL2021 or 365 versions). The way round it is to define a named range for the cells or range in that other sheet, and then to use the name within the CF expression.

    Hope this helps.

    Pete

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,711

    Re: Conditional Fornat rule referencing another sheet?

    Might help if you explained what you are trying to do. A formula would be helpful. What did you try? What did you get (or not get)?


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,711

    Re: Conditional Fornat rule referencing another sheet?

    Pete will make it work if you give him a file

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

    Re: Conditional Fornat rule referencing another sheet?

    Thanks for the vote of confidence, Trevor.

    Pete

  6. #6
    Registered User
    Join Date
    05-02-2011
    Location
    Australia
    MS-Off Ver
    Excel 2019
    Posts
    57
    Quote Originally Posted by TMS View Post
    Might help if you explained what you are trying to do. A formula would be helpful. What did you try? What did you get (or not get)?


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    I will be able to upload an example file when I get home today. EDIT: I now can get the CF rule window to acknowledge references to cells on another sheet. Not sure what I did differently. I got the rule/CF referencing the secondary sheet working applied to one cell on the primary sheet with a value in it. I am now trying to apply that same cell based VLOOKUP check CF to the other cells on the primary sheet.
    Last edited by I-Like-Excel; 05-03-2023 at 12:07 AM.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,711

    Re: Conditional Fornat rule referencing another sheet?

    @Pete: you're welcome

  8. #8
    Registered User
    Join Date
    05-02-2011
    Location
    Australia
    MS-Off Ver
    Excel 2019
    Posts
    57

    Question Re: Conditional Fornat rule referencing another sheet?

    OK, I have uploaded a sample file with a small scale version of what I am trying to do.

    I cant write the CF for ONE cell, but cant seem to use relate references to copy it across to apply the same way to all cells

    CF problem.xlsx

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

    Re: Conditional Fornat rule referencing another sheet?

    See attached file, where I have set this up for you with these formulae:

    Green Rule: =VLOOKUP(B4,Sheet2!$A$2:$B$11,2,FALSE)="P"

    Red Rule: =VLOOKUP(B4,Sheet2!$A$2:$B$11,2,FALSE)="F"

    Note also that these rules refer to the range $B$4:$F$5, so the B4 in the rules relate to the first cell within this range (and changes automatically for different columns/rows).

    Hope this helps.

    Pete
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-02-2011
    Location
    Australia
    MS-Off Ver
    Excel 2019
    Posts
    57

    Re: Conditional Fornat rule referencing another sheet?

    I was sure I did/was doing exactly what you did here on the Excel file I was originally trying to get it all to work on when I first posted!

    I got the rule equation working first for just one cell, but when I expanded the "Applies to" range, the formatting was being applied to ALL the selected cells in "Applied to" but based on just the test on the first cell (B$ in this example). ie. al the cells B4:F5 followed the format of what format B4 had, and not what the actual cell value was. I will need to triple check that again!

    Thanks!
    Last edited by AliGW; 05-03-2023 at 10:22 AM. Reason: Please do NOT quote unnecessarily!

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

    Re: Conditional Fornat rule referencing another sheet?

    You're welcome.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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: 2
    Last Post: 12-19-2022, 10:43 PM
  2. Replies: 22
    Last Post: 04-29-2022, 09:12 AM
  3. Referencing another sheet in Google Sheet with conditional formatting
    By dtommy79 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 09-03-2021, 07:37 AM
  4. Replies: 0
    Last Post: 09-03-2021, 06:59 AM
  5. conditional rule
    By durga_ikon in forum Excel General
    Replies: 2
    Last Post: 03-29-2013, 02:57 AM
  6. Conditional formatting referencing another sheet and returning multiple column items
    By Bundleodaisies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-29-2010, 04:12 PM
  7. Conditional formatting referencing another sheet and returning multiple column items
    By Bundleodaisies in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2010, 10:04 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