+ Reply to Thread
Results 1 to 6 of 6

Formula to highlight cells based on multiple criteria and sheets.

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    Edinburg, TX
    MS-Off Ver
    2010
    Posts
    19

    Formula to highlight cells based on multiple criteria and sheets.

    What I am looking to do is for the cells in sheet 2, column "G" (hours) to highlight red if they are >.2 of values in sheet 1 column "E" (TGT) only if the sheet 2, column "D" (SEQ) and sheet 1, column "B" (operation) are identical.

    enclosed is an example excel workbook. Any and all help would be greatly appreciated.
    Attached Files Attached Files
    Last edited by cascencio83; 01-16-2015 at 02:07 AM. Reason: confusion

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Formula to highlight cells based on multiple criteria and sheets.

    hi cascencio83. your questions and file is a little confusing. you first stated:
    highlight red if they are >.2 of values
    then your manual formula is:
    =AND($D1="0001",$G1>0.3)
    your file has all hours of 0.1. so i'm not sure which should be highlighted. also. in column D, they are numbers. "0001" in your formula is a text. so maybe you could give egs of which one you want to highlight. perhaps if SEQ 1 is 0.4 and Operation 1 is 0.1. is it highlighted cos it's 0.3 more than that? then give other egs like if SEQ 2 is 0.5 and Operation 2 is 0.3. it is 0.2 more, but not GREATER than 0.2. highlighted?

    if my assumption is correct, try:
    select the range you want to apply to (say from G2:G35)
    go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =(G2-VLOOKUP(D2,Sheet1!$B:$E,4,0))>0.2

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    01-14-2015
    Location
    Edinburg, TX
    MS-Off Ver
    2010
    Posts
    19

    Re: Formula to highlight cells based on multiple criteria and sheets.

    [QUOTE=benishiryo;3957937]if SEQ 1 is 0.4 and Operation 1 is 0.1. is it highlighted cos it's 0.3 more than that? then give other egs like if SEQ 2 is 0.5 and Operation 2 is 0.3. it is 0.2 more, but not GREATER than 0.2. highlighted?

    Yes you are correct sorry. Your first question if operation# = Seq# and is >.2 highlight the cell is exactly what i want. As well as your 2nd question if operation#=seq# but <or= to .2 over do not highlight.

  4. #4
    Registered User
    Join Date
    01-14-2015
    Location
    Edinburg, TX
    MS-Off Ver
    2010
    Posts
    19

    Re: Formula to highlight cells based on multiple criteria and sheets.

    Your code helped point me in the right direction the correct code was =($G1-VLOOKUP($D1,Sheet1!$B1:$E1,4,0))>0.2

    However when i was breaking down the formula to understand what you did what was the ",4,0" for? =($G1-VLOOKUP($D1,Sheet1!$B1:$E1,4,0))>0.2"

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Formula to highlight cells based on multiple criteria and sheets.

    basically, it looks for D1 inside the 1st column of B:E i selected (i.e. column B:B). i then specify i want to return the 4th column from column B (i.e. column E:E) when i find D1 in column B. the 0 is the same as typing FALSE, and both is to find an exact match. so if D1 is "apple", "appleS" in column B will return you #N/A.

    hope that helps

  6. #6
    Registered User
    Join Date
    01-14-2015
    Location
    Edinburg, TX
    MS-Off Ver
    2010
    Posts
    19

    Re: Formula to highlight cells based on multiple criteria and sheets.

    OK so on the sample book it works fine but on my actual file it does not. Could it be an issue that all the data on that sheet is being pulled from and access database that won't allow the formatting?

+ 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: 3
    Last Post: 06-17-2014, 01:13 PM
  2. [SOLVED] Highlight Duplicate Rows Based on Multiple Criteria
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2013, 09:39 AM
  3. [SOLVED] If value meets criteria, highlight adjacent cells. repeat across sheets
    By matrix_machine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2012, 07:07 PM
  4. Identify/highlight maximum value based on multiple criteria
    By JennB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2009, 06:28 PM
  5. Highlight duplicate records based on multiple criteria
    By Beckiwi in forum Excel General
    Replies: 2
    Last Post: 06-11-2008, 03:53 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