+ Reply to Thread
Results 1 to 11 of 11

Conditional formatting of a cell to change its fill color based on text any of several cel

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Conditional formatting of a cell to change its fill color based on text any of several cel

    Greetings all. Ok, I haven't found anything that matches my situation, so my apologies if I've missed it. Here goes:
    I am trying to create a menu calendar for my family. In column P, I have all of the possible entree items we might use in the month. What I'm trying to do is set up each of the cells in column P (P1 through P40) so that if any of those items is typed into the calendar (in very specific cells for what it's worth), the respective item in column P will change fill color. So let's say spaghetti is in P2 (P1 is the title of the column). If we have spaghetti on say the 12th of the month, it would be typed into cell H21 (the dinner location on the calendar for that particular date). So basically if the text in H21=spaghetti, I want cell P2 to change fill color to red. Or if we have hamburgers instead on the 12th, H21 would = hamburgers, and cell P25 (which already has the word hamburgers in it) would turn red. Make sense? Can it be done? Keep any answers SIMPLE, step-by-step please (for instance I have no idea what =AND($P5$I21)="true" means). I know where conditional formatting is, but that's about it. Excel 2007. THANKS!!!
    Last edited by gvndual; 06-19-2013 at 05:31 PM. Reason: Evidently to make it more precise

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: More conditional formatting

    Hi and welcome to the forum

    I would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.


    And while you are about it, please change your thread title to something that actually describes your problem
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Last edited by FDibbins; 06-19-2013 at 01:35 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: More conditional formatting

    I would recommend using a COUNTIF for this. If the meals are in P2:P40 and the columns where you might enter one of them is columns A:H, you could use this CF formula


    =COUNTIF(A:H, P2)>0
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: More conditional formatting

    Ok, sounds like we're working with something that might be possible. I'm uploading a copy of the file (hopefully), and if I could get slightly more specific directions (for instance, where does that formula get entered?). Remember, step-by-step. I was GREAT at BASIC (if this then that, gosub, etc), but this Excel formatting I haven't quite mastered (to say the least).
    Attached Files Attached Files

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: More conditional formatting

    And while you are about it, please change your thread title to something that actually describes your problem
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Please comply with this before we help you further

  6. #6
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: More conditional formatting

    That ought to do it I suspect.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional formatting of a cell to change its fill color based on text any of several

    1) Press F1 in Excel and read the builtin tutorials on Conditional Formatting, always the best step 1

    2) Highlight P6:P100

    3) Open the Conditional Formatting window and select NEW RULE

    4) Select USE A FORMULA TO DETERMINE WHICH CELLS TO FORMAT

    5) Enter this formula: =COUNTIF(A:O, P6)>0

    6) Click Format > Fill and select a color.

    http://screencast.com/t/jvgD0sufZ40M

  8. #8
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting of a cell to change its fill color based on text any of several

    Wow, Ok JBeaucaire, that worked for what's already filled in (although I have NO idea why...yet), but when I fill in a new cell over in the calendar, the respective menu item in column P does NOT then highlight red. Can I make it do that also?

  9. #9
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting of a cell to change its fill color based on text any of several

    Actually, it might. Weird. When I go back and forth from my browser to Excel, the cells are changing. Interesting...... It looks like this might work for what I'm looking for. I wonder why it's not instantaneous.... Oh well, I'll take it. Any other fine-tuning (other than dietary suggestions) are most welcome! Thanks all for your comments! I'm going to leave this as unresolved just until I make sure it's doing exactly what I'm looking for.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional formatting of a cell to change its fill color based on text any of several

    You can possibly check your File > Options > Formulas > Workbook Calculation and make sure it's set to Automatic.


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

  11. #11
    Registered User
    Join Date
    06-19-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting of a cell to change its fill color based on text any of several

    That was absolutely it. It was set to manual. Can't tell you how much I appreciate it! Took me 24 hours until I posted the problem, then 3 hours to get it resolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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