+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting based on criteria

  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    4

    Conditional formatting based on criteria

    Hi,
    I've created a spreadsheet to track little league pitch counts and mandatory days rest, but would like to automate it with conditional formatting on a calendar grid.

    So far, I've included a list of players, separately the criteria for days rest (this works by pitch counts, so for instance if a kid throws between 21 and 35 pitches, he needs one day rest before he can pitch again), a table to enter the pitcher/date/pitch count and a calendar grid with a formula which shows the day a pitcher threw and the number of pitches.

    What I am trying to do, is have the calendar grid automatically (with conditional formatting) gray out the days when the kid cannot pitch (i.e. the days rest they need before they can pitch again).

    I can't figure that last part out. Let me know if you can help. Thanks.

    Frank
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Conditional formatting based on criteria

    Your table says that Player one pitched on the 20th, and can pitch again on the 24th, but you have the 22nd to the 26th grayed out. is this accurate?

    This formula (starting in M3) should work, if you want player 1 to have the 21st to the 23rd grayed out (not the 24th, cause your table says he can pitch again on the 24th)

    =COUNTIFS(Table354[[Name]:[Name]],$L3,Table354[[Date Pitched]:[Date Pitched]],"<"&M$2,Table354[[Able to Pitch]:[Able to Pitch]],">"&M$2)>1
    Last edited by Melvinrobb; 12-02-2015 at 04:24 PM.
    Please click the * icon below if I have helped.

  3. #3
    Registered User
    Join Date
    07-13-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    4

    Re: Conditional formatting based on criteria

    @Melvinrobb, yes case in point why I want the conditional formatting (gray shading) to be automated based on the input from the table - to avoid making mistakes in the shading.

    So the key would be to reference the cell with the number of pitches (or the table itself - not sure what is the better way to do it) and have a formula (in the conditional formatting tool - not sure?) so that the shading results automatically after the entry is made in the table.

    Thus, a one-time entry into the table (pitcher name, date, pitches thrown) and the formula(s) fill in the calendar grid with pitch count (on day thrown) and gray out the days the pitcher cannot pitch.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting based on criteria

    The Able to Pitch dates in column F are short 1 day as the pitcher cannot pitch on the last day of required rest. Using that and MelvinRobb's formula for the "Pitching Calendar" the days work out however the pitch count isn't included as a cell can have only 1 value and this formula returns 1 for each date that rest is required.
    I re-did the formula in Column E (Days Rest) to a shorter LOOKUP formula and added an error trap for the blank cell situation. The result is the same as you had calculated.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I also changed the formula in column F (Able to Pitch) to add 1 day in a shorter formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    With the change adding one day and using MelvinRobb's formula, Conditional Formatting now shades the correct days of rest.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    07-13-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    4

    Re: Conditional formatting based on criteria

    Thank you @newdoverman - looks like this version did the trick. I will tool around with it and get back if I have any questions - thanks again!

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting based on criteria

    Thank you for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    07-13-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    4

    Re: Conditional formatting based on criteria

    @newdoverman, I combined my initial worksheet and your worksheet for the final product - see attached. Thanks again!
    Attached Files Attached Files

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting based on criteria

    Looks good. Thanks for the feedback.

+ 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 - Based on Criteria
    By mlbdc2012 in forum Excel General
    Replies: 2
    Last Post: 02-03-2015, 05:50 PM
  2. [SOLVED] Conditional Formatting Based on Two Criteria (Using VBA)
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2014, 07:19 PM
  3. [SOLVED] Conditional formatting based on two criteria
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2013, 05:44 AM
  4. [SOLVED] Conditional Formatting based on 2 criteria
    By SantosJ in forum Excel General
    Replies: 2
    Last Post: 05-23-2012, 05:11 AM
  5. Using conditional formatting based on certain criteria
    By sophy_1402 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2011, 07:32 AM
  6. Conditional formatting based on multiple criteria
    By mainemojo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2009, 09:33 PM
  7. Conditional Formatting based on 2 Criteria
    By SteelDog in forum Excel General
    Replies: 3
    Last Post: 06-23-2008, 12:58 AM

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