+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting rules, multiple conditions to check

  1. #1
    Registered User
    Join Date
    03-10-2022
    Location
    NZ
    MS-Off Ver
    365
    Posts
    2

    Conditional formatting rules, multiple conditions to check

    Hi - we have different types of milk that we test for acidity. High acidity is a problem, so I want conditional formatting to highlight these results. However, sheep milk naturally has higher acidity that other milks so has a different limit. Sheep milk limit is max 0.24, all other milks are max 0.18.

    Furthermore we get sheep milk from different customers. I have created a column that checks for "sheep" in the text of the product description and returns "Yes" if true. This future-proofs the system so if we get another sheep milk customer the formatting will still work.

    I have created a series of 4 conditional formatting rules that I want to apply in order:
    =J6>0.18, cell fill is orange
    =P6="No", no format set and stop if true
    =P6="Yes", change cell fill back to white (sheep results from 0.19-0.24 show as normal)
    =J6>0.24, change font to red bold.

    However the series of formulas seems to be only doing the first rule and not progressing. What am I doing wrong?
    Attached Images Attached Images
    Last edited by TomPeregrinNZ; 03-10-2022 at 05:49 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    864

    Re: Conditional formatting rules, multiple conditions to check

    Try a single rule with the formula:

    =J6>IF(P6="Yes",0.24,0.18)

    Edit - noticed you had different formats for sheep and non-sheep. In which case use two formulae:

    =AND(P6="Yes",J6>0.24)
    =AND(P6="No",J6>0.18)

    I've had trouble with conditional formatting apparently "stopping" when it is not supposed to, as well. But I think later rules don't override earlier ones if they apply to the same text. So I guess it colours orange if >0.18, and then otherwise has no format.
    Last edited by nick.williams; 03-10-2022 at 05:55 PM.

  3. #3
    Registered User
    Join Date
    03-10-2022
    Location
    NZ
    MS-Off Ver
    365
    Posts
    2

    Re: Conditional formatting rules, multiple conditions to check

    Awesome, that's perfect thankyou
    Attached Images Attached Images

  4. #4
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    864

    Re: Conditional formatting rules, multiple conditions to check

    Glad it helped.

    Personally the red text doesn't stand out to me like highlighting does, so I'd probably highlight it a different colour (or orange with red text), but obviously up to you.

+ 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. Multiple Conditional Formatting Rules
    By greggor36 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2018, 08:27 AM
  2. [SOLVED] Using if and And together in conditional formatting multiple rules!
    By Katieloulouise in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-03-2015, 01:00 PM
  3. Conditional Formatting Rules from multiple columns based on conditions!!!
    By vijay4b7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-08-2014, 05:22 PM
  4. Conditional Formatting, multiple rules
    By jsch08 in forum Excel General
    Replies: 1
    Last Post: 04-30-2013, 11:30 PM
  5. Conditional Formatting with multiple rules
    By carrod65 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2012, 03:43 PM
  6. Conditional formatting multiple rules
    By candrew03 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-16-2011, 02:35 PM
  7. Conditional Formatting Multiple Rules
    By ems.payroll in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-07-2008, 12:31 PM

Tags for this Thread

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

X vBulletin 4.1.8 Debug Information

  • Page Generation 0.06024 seconds
  • Memory Usage 8,957KB
  • Queries Executed 16 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (4)navbar_noticebit
  • (6)option
  • (2)postbit_attachment
  • (4)postbit_legacy
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (4)showthread_bookmarksite
  • (7)showthread_similarthreadbit
  • (1)showthread_similarthreads
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper
  • (1)vbseo_linkbackmenu_entry 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (39):
  • ./vbseo.php
  • ./env.php
  • ./vbseo/includes/functions_vbseo.php
  • ./vbseo/includes/functions_vbseo_pre.php
  • ./vbseo/includes/functions_vbseo_url.php
  • ./vbseo/includes/functions_vbseo_createurl.php
  • ./vbseo/includes/functions_vbseo_db.php
  • ./vbseo/includes/functions_vbseo_vb.php
  • ./vbseo/includes/functions_vbseo_seo.php
  • ./vbseo/includes/functions_vbseo_misc.php
  • ./vbseo/includes/functions_vbseo_crr.php
  • ./vbseo/includes/functions_vbseo_cache.php
  • ./vbseo/includes/functions_vbseo_hook.php
  • ./vbseo/includes/functions_vbseo_startup.php
  • ./includes/config.php
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/functions.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/functions_cforum.php
  • ./includes/functions_facebook.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php
  • ./includes/functions_notice.php 

Hooks Called (50):
  • init_startup
  • friendlyurl_resolve_class
  • database_pre_fetch_array
  • database_post_fetch_array
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • fetch_musername
  • cache_templates
  • template_register_var
  • parse_templates
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • showthread_similarthread_query
  • showthread_similarthreadbit
  • forumrules
  • showthread_bookmarkbit
  • navbits
  • navbits_complete
  • showthread_complete


Search Engine Friendly URLs by vBSEO 3.6.0 RC 1