+ Reply to Thread
Results 1 to 5 of 5

Varied Criteria for IF Function in Conditional Formatting

  1. #1
    Registered User
    Join Date
    01-15-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    96

    Varied Criteria for IF Function in Conditional Formatting

    Solved. thank you
    Attached Files Attached Files
    Last edited by Alphabex; 09-02-2016 at 06:45 PM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Varied Criteria for IF Function in Conditional Formatting

    Don't become another member of the 'IF' club, there are many other, often better / simpler ways to do things.

    Take your formula in B7 for example, =IF($G$3=1,B13,IF($G$3=2,C12,IF($G$3=3,D12,IF($G$3=4,E12,IF($G$3=5,F12)))))

    You have an IF for each week (and what appears to be an error, B13 should be B12?), when you don't really need any of them, you could simply use =INDEX(B12:F12,G3)

    Setting your sheet up more efficiently also helps considerably.

    For your criteria table below, have 1 column per week, lets say column I for week 2, and lets use Row 14 for the week numbers, so week 2 in I14, J14 for week 3, K14 for week 4, L14 for week 5.

    Now beneath the week numbers enter the minimum score for the red condition, so I15, J15, K15 and L15 should all contain 0 (number only, don't add any text such as 'pts' to it).

    In the next row enter the minimum score for the yellow conditions, so 8 in I16, 13 in J16, 17 in K16 and 26 in L16.

    Repeat the pattern in the next 2 rows for the minimum scores for the green and gold conditions.

    Then you can refer to that table in conditional formatting with some simple formulas.

    For the red condition, you could use

    =MATCH($B$7,INDEX($I$15:$L$18,0,MIN($G$3,5)))=1

    For the other conditions, you just need to change the last number, =2 for yellow, =3 for green and = 4 for gold.

    The bit in bold text caps the week number at 5, so the criteria in column L will be used for weeks 5 to 12 (or longer).

    Have a go at setting it up yourself, you know where to find us if you get stuck.

  3. #3
    Registered User
    Join Date
    01-15-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    96

    Re: Varied Criteria for IF Function in Conditional Formatting

    im stuck....I reattached where I am in the process. I built the conditions as specified, but the cell isn't reflecting the correct color for the week. What am I doing wrong here?
    Thank you for the INDEX tip. I just got used to IF formulas, so now I need to learn Index better.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Varied Criteria for IF Function in Conditional Formatting

    Sorry, that was my bad!

    I forgot to adjust the formula to allow for the fact that week 2 is the first week, so everything needs to be reduced by 1.

    =MATCH($B$7,INDEX($I$15:$L$18,0,MIN($G$3,5)-1))=1

    Or you could use

    =MATCH($B$7,INDEX($I$15:$L$18,0,MATCH($G$3,$I$14:$L$14)))=1

    as an alternative, which looks for the week number in row 15 that is equal to, or before the number in G3, rather than assuming that they are consecutive (which the first formula does).

  5. #5
    Registered User
    Join Date
    01-15-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    96

    Re: Varied Criteria for IF Function in Conditional Formatting

    Thank you Thank you!!!!! I am about to log a new post regarding a Vlookup with multiple criteria, which I guess is probably going to be another INDEX/MATCH type solution. I did try on my own, but still stuck.

+ 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. [SOLVED] Conditional Formatting for 2 criteria.
    By melnemac32 in forum Excel General
    Replies: 3
    Last Post: 05-03-2013, 07:46 AM
  2. Replies: 1
    Last Post: 09-14-2010, 03:45 AM
  3. IF statement using formatting criteria (NOT conditional formatting)
    By chelseasikoebs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2009, 01:57 AM
  4. Can I set more than three criteria for conditional formatting?
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 03:05 PM
  5. Can I set more than three criteria for conditional formatting?
    By David McRitchie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  6. Can I set more than three criteria for conditional formatting?
    By River in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. Can I set more than three criteria for conditional formatting?
    By River in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. Macro function needed for varied searches using a data filter
    By CC_rider in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2005, 03: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