+ Reply to Thread
Results 1 to 12 of 12

Filling text via conditional formatting

  1. #1
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Filling text via conditional formatting

    Is it possible to have the text of a cell stipulated/populated via conditional formatting?
    I still need the cell to be manually filled by other text as needed by the user, but have the capacity to fill itself based on the value of another cell.

    SO! Example time:

    I need cell C5 to populate as "Meetings", but only under the condition that cell A5 states "Meetings". So, if A5 specifies something else, like a customer name, for example, then C5 can still be filled as necessary by the user.

    I'm honestly not sure whether this is possible or not. It would need to be conditional formatting or something similar. Macros are a no-go as a lot of our users aren't macro compatible (or rather, their copies of Excel/laptops).

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

    Re: Filling text via conditional formatting

    No, you can't insert text with Conditional Formatting, that only changes cell visual characteristics, like color and borders.

    You can put a formula into that cell that will offer "Meetings" as a default answer if the condition is met and show blank otherwise. The user can always TYPE into that cell in either case, but after that the original formula would be forever gone.

    If you're building this into a template, then that shouldn't be problematic, each new copy of the opened template would have the formula back in C5 at the start of use.

    The formula could be:

    =IF(C5="Meetings", "Meetings", "")
    _________________
    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!)

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Filling text via conditional formatting

    Try this to see if this helps.....

    Select C5 --> Conditional Formatting --> New Rule --> Use a formula to determine which cells to format --> In the box below "Format values where this formula is true", paste the formula given below --> Format --> Number Tab --> Custom --> In the box below "Type" (General is written there by default), type this "Meetings" ;@ --> OK.

    Formula:
    Please Login or Register  to view this content.
    So if the cell A5 contains the word "Meetings", C5 will show "Meetings" otherwise C5 will show you the value entered into it.
    Is this what you are trying to achieve?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Filling text via conditional formatting

    Nominally, yes. That is the objective. I implemented the recommendations outlined above but C5 didn't populate. Everything looks correct, but the text isn't coming up.

  5. #5
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Filling text via conditional formatting

    Tracking Log v4.0 - Sample.xlsx

    Here's an attached sample workbook to show my progress. Please feel free to manipulate as needed.

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Filling text via conditional formatting

    It works actually but has a drawback which I forgot to mention that you need to input something in the cell C5 and if A5 contains Morning Meeting, C5 will show you Meetings not the value you entered into it. So see if this is something you can work with.

    Or another way around this is you can use a VBA code (For Worksheet Change Event) to achieve this very easily.

    I have attached two sheets here for your reference. One is Tracking Log v4.0 - Sample.xlsx which contains the conditional formatting applied.
    And another is Tracking Log v4.0 - VBA Code.xlsm which contains a VBA code, please read the notes on the sheet to know how this code works. You can find the code on Monday Sheet Module by Right clicking on Monday Sheet Tab --> View Code
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Filling text via conditional formatting

    The conditional formatting works great, with that in mind. Thank you.
    One additional question/addendum, however. Is there a way for that conditional formatting to work with putting a text value in C5 rather than a numerical value? I've noticed it doesn't populate when I test using text values - only numerical.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Filling text via conditional formatting

    In that case change your custom format to ;;;"Meetings" but the problem with this is what if a user enters a numeric value in col. C and then it will not work. To overcome this you may add data validation to restrict user to input a numeric value in col. C by following these steps.....
    Select C5 --> Data --> Data Validation --> Allow --> Custom --> Formula --> =ISTEXT(C5) --> OK.

    But if you ask me I find VBA code is much more convenient than the conditional formatting. Choice is yours.

  9. #9
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Filling text via conditional formatting

    So there's no way to use conditional formatting to overwrite both text and numbers?

    I prefer the formulas and equations because I understand that terminology much more thoroughly. My VBA skills are pretty terrible so I can't adjust that or easily apply it elsewhere. I'm not even sure where to look to see if I can figure my way through your coding.

    Additionally, this template is passed through a fairly large department of several dozen people. Unfortunately, a lot of them have had issues with VBA enabled workbooks in the past.

  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: Filling text via conditional formatting

    Consider the option in post #2. Since each row is used once, the formula would be there at the initial use of any single row, and only be deleted if someone types a manual entry over it. I do this all the time in my template tables.

  11. #11
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Filling text via conditional formatting

    Quote Originally Posted by CorvusReed View Post
    So there's no way to use conditional formatting to overwrite both text and numbers?
    In that case you need to make two separate rules for conditional formatting in col. C. One rule if the user inputs a numeric value in col. C and another if the user inputs a text string in col. C.
    Please find the attached sheet where I have applied these two rules for conditional formatting to see if this works as per your requirement now.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-27-2013
    Location
    Irving, Texas
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Filling text via conditional formatting

    Ah, yes, two separate rules would be fine. I'd much rather go that route than have the users write over a visible equation. My coworkers believe Excel equations like that to be synonymous to witchcraft and panic at anything beyond basic inputs.

    So for bonus points, is there any way that you can walk me through the logic of how these conditional statements were written? I understand what they should look like and how to create them, but I don't really understand why they need to look that way. Why are the semicolon's needed for text and the semicolon + @ symbol needed for numerical inputs?
    Last edited by CorvusReed; 11-11-2014 at 05:03 PM.

+ 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. Auto filling Conditional Formatting
    By pete2106 in forum Excel General
    Replies: 3
    Last Post: 04-09-2013, 05:54 AM
  2. Replies: 3
    Last Post: 02-12-2013, 12:55 PM
  3. Gradient Filling in Conditional Formatting
    By Tommy1005 in forum Excel General
    Replies: 0
    Last Post: 02-21-2011, 11:43 AM
  4. Filling conditional formatting.
    By Jo-Jo in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-25-2009, 10:19 PM
  5. Replies: 9
    Last Post: 01-27-2009, 11:11 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