+ Reply to Thread
Results 1 to 2 of 2

Value based on color formatting of cell

  1. #1
    Registered User
    Join Date
    11-06-2003
    MS-Off Ver
    Excel 2007
    Posts
    13

    Value based on color formatting of cell

    I've got a situation where I have a range of cells, say A1:E1, which are used as a scoring field (i.e. values 1-5 respectively). The score of an event is indicated by filling one of the 5 cells with a color (light yellow). I need a formula in F1 which will tell me the numerical value of the cell which was selected by being filled with "light yellow" for the score (i.e. 1, 2, 3, 4 or 5).

    Thanks.

    Mike

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    You could use the following function in a module:
    Please Login or Register  to view this content.
    To return the value in A1:E1 with a light yellow background, in cell F1 you could type:

    =getYellow(A1:E1)

    It could be used for any range, of course, not just A1:E1. One thing to note.. if you make any changes, e.g. change the light yellow cell or change any cell values, you'll need to press F9 to re-calculate the entire sheet, which will update the function's result.

    To add a module:
    1. Press ALT+F11 to open the VB Editor, then ALT+I+M to insert a module.
    2. Copy the above function and paste it into that module.
    3. Close the VB Editor window
    Last edited by Paul; 03-08-2008 at 01:26 AM.

+ 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