+ Reply to Thread
Results 1 to 25 of 25

Conditional Formatting question

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Conditional Formatting question

    H3 = XL
    H16 = XL
    H28 = XL


    formula for conditional formatting
    =H3="XL" works.

    I tried =H3,H16,H28="XL" but doesn't work

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Can you give more context to your situation?

    Is what you showed, in Applies To, or in "Use Formula"?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    "Use Formula"
    Please see the attached screenshot

    xl.PNG

  4. #4
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Actually, the cell H$3 contains formula
    =VLOOKUP(B$3,TblEvents,3,0),"")

    I tried putting this formula in "use formula" but doesn't work,
    not sure if its possible.

    Thanks.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Try removing the $
    =H3="XL"

    Make sure your Applied To range covers all the cells you need to apply this to, eg H3:H28

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Quote Originally Posted by mikehk View Post
    Actually, the cell H$3 contains formula
    =VLOOKUP(B$3,TblEvents,3,0),"")...
    Thanks.
    There is something missing from that formula, probably an IF statement?

  7. #7
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Quote Originally Posted by FDibbins View Post
    Try removing the $
    =H3="XL"

    Make sure your Applied To range covers all the cells you need to apply this to, eg H3:H28

    formula for conditional formatting
    =H3="XL" works.

    I tried =H3,H16,H28="XL" but doesn't work

    Since the same values "XL" are multiple times, I don't know if conditional formatting
    can work with =H3,H16,H28="XL"


    I have no issues with "applies to"

  8. #8
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Quote Originally Posted by FDibbins View Post
    There is something missing from that formula, probably an IF statement?
    you are right...complete formula is
    =IFERROR(VLOOKUP(B$3,TblEvents,3,0),"")

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Conditional Formatting question

    If you want to chexk if all three cells contain XL try
    =AND(H3="XL",H16="XL",H28="XL")

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Did you try my suggestion on post #5?

  11. #11
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    I tried all methods but still can't figure it out.
    Please see the attached sample file explaining my query.

    Thank you.
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,432

    Re: Conditional Formatting question

    You need three CF rules, one for each colour:

    =IIFERROR(VLOOKUP(B$3,TblEvents,3,0),"")="H"

    =IIFERROR(VLOOKUP(B$3,TblEvents,3,0),"")="M"

    =IIFERROR(VLOOKUP(B$3,TblEvents,3,0),"")="L"
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Ali, couldnt you do that without the iferror?
    =VLOOKUP(B$3,TblEvents,3,0)="H"
    etc?

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,432

    Re: Conditional Formatting question

    Probably, yes.

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional Formatting question

    Brrrrrrrrrrrrrrrrrrrrrrr. Spreadsheet full of merged cells

  16. #16
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Thank you everyone... got it working.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,432

    Re: Conditional Formatting question

    You're welcome! Thanks for the rep.

  18. #18
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Quote Originally Posted by FDibbins View Post
    Ali, couldnt you do that without the iferror?
    =VLOOKUP(B$3,TblEvents,3,0)="H"
    etc?
    This formula is working on B3 row, if I want to apply to other Rows such as B15, B26...
    I will have to create more CF rules. Is there anyway to have a single formula that
    can work on all rows.

    Please see the attached file.

    Thank you.
    Attached Files Attached Files

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Try this for the cell formula...
    =IFERROR(VLOOKUP($B3,TblEvents,4,0),"")
    and this for the CF rule
    =VLOOKUP($B3,TblEvents,4,0)=H

    You can copy that to the other rows, but you will need a rule for each M, H etc

  20. #20
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Thanks FDibbins, your formula works... I have 6 rows and each row has 3 conditions (H, M, L).
    I was hoping if COLUMN() or ROW() function could be used to make less CF rules.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,432

    Re: Conditional Formatting question

    You only need three rules applied to the whole range you wish to cover.

  22. #22
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    The 3 rules work for Row B$3, for Row B$26 I need to make the 3 rules again and 3 rules again for Row B$35

  23. #23
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    No you dont. Make up the 3 rules in the 1st cell, like I showed you - using the cell formula I showed as well.
    You can then just copy that cell to the other locations.

  24. #24
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Conditional Formatting question

    Sorry FDibbins, it doesn't work.

    formula in cell is
    =IFERROR(VLOOKUP(B$3,TblEvents,4,0),"")

    CF rule
    =VLOOKUP(B$3,TblEvents,3,0)="H"

    it only works in Row B$3, and I have to copy paste for Row B$15, B$26 and so on....
    Sample file is attached to post # 18, you may give a try.

    Thanks.

  25. #25
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional Formatting question

    Your formulas are not quite the same as what I suggested....
    Try this for the cell formula...
    =IFERROR(VLOOKUP($B3,TblEvents,4,0),"")
    and this for the CF rule
    =VLOOKUP($B3,TblEvents,4,0)=H
    Look at where the $ is in B3

+ 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. Conditional Formatting Question
    By jeff17408 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2017, 12:59 PM
  2. Conditional Formatting Question
    By CAROLYNQ in forum Excel General
    Replies: 1
    Last Post: 07-06-2012, 11:24 AM
  3. Conditional Formatting question
    By ezdizzy in forum Excel General
    Replies: 3
    Last Post: 04-27-2012, 03:40 PM
  4. conditional formatting question
    By fujimi-cho in forum Excel General
    Replies: 7
    Last Post: 10-22-2007, 03:29 AM
  5. Conditional Formatting Question
    By livifivil in forum Excel General
    Replies: 5
    Last Post: 07-29-2006, 02:31 PM
  6. [SOLVED] Conditional formatting question
    By Carl Imthurn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 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