+ Reply to Thread
Results 1 to 12 of 12

=IF (cell color) then?

  1. #1
    Registered User
    Join Date
    06-28-2006
    Posts
    24

    Cool =IF (cell color) then?

    Two part question:

    1. How do I structure an IF statement based on a specific cell color (e.g. if a cell is yellow, then perform function x)

    2. How do I know what color is what? Is there a pantone reference? A color "name" that excel uses?

    Thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: =IF (cell color) then?

    why is the cell coloured?
    you can use conditional format to colour the cell then use the same criteria in a function
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    06-28-2006
    Posts
    24

    Re: =IF (cell color) then?

    The cells are not conditionally formatted...it is a manual process based on non-conditional input.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: =IF (cell color) then?

    Excel does not have a built in function to determine cell color. You would need to use VBA code to determine cell color.

    If you can use a VBA solution, search the Forum using terms like: Count cells by color, or Sum cells by color, etc.

    To martin's point, what logic are you using to determine cell color? If the fill color selection is a random process (no logic or consistency), then it will be a bit difficult to determine which cells to reference in any formula.

    Sum/Count Cells By Fill Or Background Color in Excel
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: =IF (cell color) then?

    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  6. #6
    Registered User
    Join Date
    06-17-2011
    Location
    Maine
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: =IF (cell color) then?

    I could use help with this also, to be specific, I am taking data and assigning it a confidence level. The confidence level is going to be indicated by the use of cell background color, ie a green cell indicates a +/- 10% confidence level and therefore my expected data rande is X+(X*.1) and X-(X*.1) and so on (X being my measured sampled.

    How do I create function so that IF the cell is one it uses one confidence level, if its another then a different one, etc?

  7. #7
    Registered User
    Join Date
    02-07-2009
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    17

    Re: =IF (cell color) then?

    I know I am digging an old post here, but I wonder if the new excel 2013, has a solution to this. I am manually colouring a cell and want it show an x value (referenced from a different cell), if the colour is say green and a 0 if its red.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: =IF (cell color) then?

    on_way_to_fame,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    02-07-2009
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    17

    Re: =IF (cell color) then?

    Hi,

    Apologies for that. I will create a new thread for this.

  10. #10
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: =IF (cell color) then?

    Writing a macro that creates a function (customized excel formula) is the trick you are looking for. What is the "perform x" that you want it to do exactly?

  11. #11
    Registered User
    Join Date
    11-05-2014
    Location
    Comfort, TX
    MS-Off Ver
    Office 2010
    Posts
    1

    Re: =IF (cell color) then?

    On_way_to_fame,
    Did you ever find a solution to your problem? I am trying to do the same thing.

  12. #12
    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,929

    Re: =IF (cell color) then?

    baffled, perhaps you missed reading post #8?

    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

+ 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