+ Reply to Thread
Results 1 to 9 of 9

Custom Text Formatting to change colour and text in cell based on value in adjacent cell

  1. #1
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Custom Text Formatting to change colour and text in cell based on value in adjacent cell

    Hello..

    I have been trying to color code the cell based on the cell value. if the cell value is Contra Font color should be in red and if its Opex should be in Green. I have tried something to do but seems like its not working as expected.

    Attached is the sample sheet for reference. I dont wanna use Conditional Formatting here. just Custom formatting or next Text function with in IF statement.

    Thanks,
    Sri
    Attached Files Attached Files
    Last edited by Sri.n; 05-16-2022 at 03:25 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,438

    Re: Custom Text Formatting

    If you don't want to use CF (which is the tool designed for this), then this cannot be done without VBA - shall I move your thread for you?
    Last edited by AliGW; 05-13-2022 at 12:18 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Re: Custom Text Formatting

    Hi Ali, I was thinking if we can use the Custom formatting or Text function nested in IF condition. If my thought is wrong pls move the thread.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,438

    Re: Custom Text Formatting

    You cannot control text formatting using the TEXT function - formulae and functions cannot read or write formatting to a cell.

    In the workbook, you have not shown what you want, but the tool that does what you seem to be describing is conditional formatting - that is what it is for.

    Before I move the thread, show us what you want.

  5. #5
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Re: Custom Text Formatting

    Hi Ali,

    this is my requirement. I have attached the file with expected output.

    In Cell G3, IF Value of F3 is more than 5m then its should show as Contra with Font Color/Fill cell as Green, if that’s not show as Opex in Red
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,438

    Re: Custom Text Formatting

    OK - thanks. This confirms my understanding.

    Custom text formatting can work only on the cell it's applied to and not refer to an adjacent cell.

    You have only one option: VBA.

  7. #7
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,493

    Re: Custom Text Formatting to change colour and text in cell based on value in adjacent ce

    Pls Try Cell G2 formula , Drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The active sheet places the code as below

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Re: Custom Text Formatting to change colour and text in cell based on value in adjacent ce

    Thanks you everyone for helping out..

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,493

    Re: Custom Text Formatting to change colour and text in cell based on value in adjacent ce

    @Sri.n You're Welcome. Glad to help . Thank You for the feedback and for marking the thread as 'Solved'.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Last edited by wk9128; 05-13-2022 at 02:09 AM.

+ 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] Problem Custom Formatting with Dynamic Text
    By zot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2020, 11:35 AM
  2. [SOLVED] TEXT formula with custom currency formatting
    By Blu3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-13-2020, 11:43 AM
  3. [SOLVED] Custom Formatting Number to Text
    By cbramsey in forum Excel General
    Replies: 1
    Last Post: 08-01-2017, 08:50 AM
  4. Custom Cell Formatting (text and number)
    By dgournea in forum Excel General
    Replies: 2
    Last Post: 08-09-2009, 03:19 PM
  5. Custom Formatting/Text & Number Cell
    By Special-T in forum Excel General
    Replies: 9
    Last Post: 03-04-2007, 12:57 PM
  6. [SOLVED] text / number string custom formatting
    By nastech in forum Excel General
    Replies: 0
    Last Post: 04-27-2006, 02:35 PM
  7. [SOLVED] Custom text formatting in Excel 2000
    By Ketchup in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2005, 01:03 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