+ Reply to Thread
Results 1 to 7 of 7

"CELL" Function, detecting color format

  1. #1
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    "CELL" Function, detecting color format

    Hi, I would like to ask...

    Lets say...
    ---------A-----------B
    1-----color
    2
    3-----color
    *"Color" = the cell is not in default color format (white)

    I wanted it to show me in column B that which cell in column A is formatted in cell color.
    Is it correct for me to use B = CELL("color",A) ? (where A= A1, A2 ; B= B1, B2 & etc)

    And I have read the Excel Help file countless times on this function... Can anyone please tell me what does it mean by "Negative Values" in the CELL's color function?
    " "color" -- 1 if the cell is formatted in color for negative values; otherwise returns 0 (zero). "

    Thank you in advance!
    Last edited by SCLai; 09-06-2010 at 03:19 AM.

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: "CELL" Function, detecting color format

    The =CELL("color",A1) function will return the value 1 if the cell is formatted to display in color for negative values.

    In Column A cell 1 format the cell for Numbers and select either of the two red negative displays.
    In Column B cell 1 enter the formula =CELL("color",A1)
    When you enter any number in cell A1, such as minus 123.00 ( -123.00 ) or just 123.00
    then cell B1 will display the number 1
    As far as I know, there are only two selections that offer the display of colors for negative values they are Numbers and Currency.
    Last edited by xenixman; 09-05-2010 at 11:28 PM.

  3. #3
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: "CELL" Function, detecting color format

    Oh my... looks like I have missed it completely

    So is there any way that I can get cell information regarding the coloring of the cell (Cell Fill Color)?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: "CELL" Function, detecting color format

    Not without Code in some form or other.

    You can use the old XLM GET.CELL (function 63) from a Name else you can use a UDF to return the Interior.ColorIndex

    Note: altering the format of a cell is a non-volatile action meaning the function(s) returning the colour will not update automatically when you modify the format of the precedent cell
    (even if UDF is set to Volatile and or Name uses a Volatile reference [eg INDIRECT]).

    For the above reasons differentiation by means of format is ill advised
    (unless of course the formatting is itself determined by logic - ie Conditional Formatting rules - at which point note that the colour generated by CF is not returned by the interior.colorindex)

  5. #5
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: "CELL" Function, detecting color format

    Thanks for the information... I think that its too complex for me as of now.
    Thanks again for all the help!

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: "CELL" Function, detecting color format

    I put together a basic demo workbook on GET.CELL (function 63) for this thread.

    http://www.excelforum.com/excel-work...ml#post2376831

    The attached file has some additional examples.

    DonkeyOtes' advice still stands.

    Hope this helps.

    N.B. you will need to enable macros if you use 2007 and above to use this file

    [EDIT]
    Added the attachment I forgot to do in the first place!
    Attached Files Attached Files
    Last edited by Marcol; 09-09-2010 at 03:52 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Forum Contributor SCLai's Avatar
    Join Date
    08-18-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: "CELL" Function, detecting color format

    Wow thanks for the help... it works xD

+ 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