+ Reply to Thread
Results 1 to 7 of 7

Formula based on color

  1. #1
    Registered User
    Join Date
    05-17-2020
    Location
    Heiloo, Nederland
    MS-Off Ver
    2007
    Posts
    32

    Formula based on color

    Good evening to all.
    It's been a while and that's a good sign, hehe.
    Well, the question I have is simple, the answer might well be as simple or not.
    I have a list of numbers, usually from 1 to somewhere around 60. Usually, the background color is white. Sometimes, the background color is yellow, indicating something special. The cells / numbers and colors are copied and pasted from a website, so I have no influence in coloring the cells to begin with (I can change that, but I don't want to).
    So, the question is: is there a possibility / formula / something that can give another cell a specific value, say 'Y', when the background color of another cell is yellow? I don't want that with white, only with yellow...
    I couldn't come up with any formula in my head. If the answer is 'no', that's sufficient, too, of course, than I'll have to hand-pic the cells out. Just I like excel to do what it can so I don't have to do it, thus minimizing errors.
    Thanks in advance!
    Greets,
    Dani螔.
    Thank you for your helpful answer.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula based on color

    Excel does not have anything built-in that you can use in formula based on color but it can be done with VBA. I can give VBA specifics if you provide a sample file to show exactly what colors are being used.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-17-2020
    Location
    Heiloo, Nederland
    MS-Off Ver
    2007
    Posts
    32

    Re: Formula based on color

    See attachment. This is the color yellow I'm referring to.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula based on color

    I have created a function called IsYellow in your file. I used it in a formula to show Y when a cell fill color is yellow. See attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-17-2020
    Location
    Heiloo, Nederland
    MS-Off Ver
    2007
    Posts
    32

    Re: Formula based on color

    Is it really that simple... Thank you!

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula based on color

    Another option is the old Macro4 commands within a Defined name
    In your example, with the active cell being C1
    Defined Name BGCol = GET.CELL(38, Sheet1!B1)
    Then in C1 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    NOTE: Just like with VBA, you'd need to save the file as an xlsm file.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    05-17-2020
    Location
    Heiloo, Nederland
    MS-Off Ver
    2007
    Posts
    32

    Re: Formula based on color

    Thanks again. Going to try both solutions. See what's working best in my huge (I mean huge) file. :-)

+ 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. Help with formula based on color
    By ray.whittington50 in forum Office 365
    Replies: 1
    Last Post: 02-17-2019, 12:58 AM
  2. Creating a formula based off Color
    By tylermprice in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-21-2017, 01:38 PM
  3. formula based on font color
    By Jpress in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-31-2016, 04:27 AM
  4. formula based on font color
    By Jpress in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-31-2016, 02:09 AM
  5. Formula based on cell color
    By kimmycoop910 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2016, 02:14 PM
  6. Set Cell Color based on a formula
    By alewson in forum Excel General
    Replies: 5
    Last Post: 08-18-2015, 05:24 PM
  7. Formula Based on Color
    By bmossman in forum Excel General
    Replies: 1
    Last Post: 05-01-2007, 03:17 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1