+ Reply to Thread
Results 1 to 3 of 3

how to combine vlookup and conditional formating

  1. #1
    Registered User
    Join Date
    01-23-2024
    Location
    indonesia
    MS-Off Ver
    Office 365
    Posts
    33

    how to combine vlookup and conditional formating

    Greetings everyone.
    anyone can teach me how to combine Vlookup/hlookup with conditional formating?
    i have a list of name with a fee limit for everyone.
    each week everyone will spend some money. if the amount spend exceed the limit. i need the cell beside the name become red like example that i provide, and vice versa. if it is below limit, i need it to become green.
    Note, the fee for week 1, 2, 3, and 4 will be input manually. after the admin input the amount, i want the rules to kick in.
    please do inform me, if my explanation are not enough.
    hope anyone can tell me step by step.

    thank you.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: how to combine vlookup and conditional formating

    Two CF rules for I5.

    Green:

    =AND(I5<>"",I5<=VLOOKUP(H5,C$5:D$23,2,0))

    Red:

    =AND(I5<>"",I5>VLOOKUP(H5,C$5:D$23,2,0))

    Both apply to: =$I$5:$I$23
    Attached Files Attached Files
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,101

    Re: how to combine vlookup and conditional formating

    you could use

    =COUNTIFS($C$5:$C$23,H5,$D$5:$D$23,">="&I5)

    and in conditional formatting
    2 rules
    1 for red
    =COUNTIFS($C$5:$C$23,H5,$D$5:$D$23,">="&I5)=0

    1 for green
    =AND(I5<>"",COUNTIFS($C$5:$C$23,H5,$D$5:$D$23,">="&I5)=1)

    OR you could colour all the cells Green , and then just use the red rule

    for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
    Conditional Formatting

    Highlight applicable range >>
    I5:I23 - Change, reduce or extend the rows to meet your data range of rows

    Home Tab >> Styles >> Conditional Formatting
    New Rule >> Use a formula to determine which cells to format
    Edit the Rule Description: Format values where this formula is true:
    =AND(I5<>"", COUNTIFS($C$5:$C$23,H5,$D$5:$D$23,">="&I5)=0)

    Format [Number, Font, Border, Fill] fill red
    choose the format you would like to apply when the condition is true
    OK >> OK

    Then repeat for green
    =AND(I5<>"",COUNTIFS($C$5:$C$23,H5,$D$5:$D$23,">="&I5)=1)

    Now you can also setup the rules in
    L, O & R
    Attached Files Attached Files
    Last edited by etaf; 08-03-2024 at 11:38 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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: 03-29-2016, 08:54 PM
  2. combine 2 conditional formating rules
    By abaines in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-13-2014, 09:58 AM
  3. Replies: 5
    Last Post: 03-14-2014, 04:03 AM
  4. [SOLVED] how to use vlookup with conditional formating
    By amr7 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-01-2014, 10:42 PM
  5. Replies: 4
    Last Post: 01-23-2014, 10:14 AM
  6. VLOOKUP and conditional formating
    By Peinecone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-15-2007, 09:52 PM
  7. VLOOKUP & Conditional Formating Help.
    By Excel'ed Failures in forum Excel General
    Replies: 6
    Last Post: 08-16-2005, 12: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