+ Reply to Thread
Results 1 to 8 of 8

Formula to return the heading if its cell highlighted in certain colour

  1. #1
    Registered User
    Join Date
    11-30-2020
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    8

    Formula to return the heading if its cell highlighted in certain colour

    Hi
    I was wondering if there is a formula to help me with this data to return the heading of a column if one of its cells is highlighted in a certain colour. The highlights are placed randomly. I have attached a sample data here if it helps. The data is in Table A, and I'm trying to achieve an outcome as shown in Table B.

    Blue for Term 3
    Green for Term 2
    Beige for Term 1

    Thanks!
    Attached Files Attached Files

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Formula to return the heading if its cell highlighted in certain colour

    Formulae cannot use cell formatting (including colour) as criteria. This means that you cannot do with a formula what you have shown in the sample - sorry. Whether or not it can be done with VBA, I don't know, but shall I move the thread for you to that section?
    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
    Registered User
    Join Date
    11-30-2020
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    8

    Re: Formula to return the heading if its cell highlighted in certain colour

    Hi Ali
    Thanks so much for getting back to me. I'm not familiar with VBA so would really prefer to use formula if at all possible.
    If I updated the colours into a, b, c, would it help? I have attached the updated sample again. Thanks!

    cheers
    Linvin
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,829

    Re: Formula to return the heading if its cell highlighted in certain colour

    Given your spreadsheet, why doesn't the row for "E" have Placement 4 under Term 1, and why not Placement 1 under Term 3 on row "M" or (row 34), etc.?

  5. #5
    Registered User
    Join Date
    11-30-2020
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    8

    Re: Formula to return the heading if its cell highlighted in certain colour

    Hi yes they should have all those you mentioned, so sorry for the confusion, I only added 3 for an example but I think you got the idea.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,829

    Re: Formula to return the heading if its cell highlighted in certain colour

    I put the letters "a", "b", and "c", in cells B19:D19, then I entered this formula into Cell B22. Then copy over and down:

    =IFERROR(INDEX($B$2:$K$2,,MATCH(B$19,$B3:$K3,0)),"")

  7. #7
    Registered User
    Join Date
    11-30-2020
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    8

    Re: Formula to return the heading if its cell highlighted in certain colour

    That looks so simple yet it works like a charm. Thanks so much for your help. I need to remember this index-match formula better.

  8. #8
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Formula to return the heading if its cell highlighted in certain colour

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Search cells based on student name, cell background colour and return a tally for colour
    By drof_06 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2016, 04:31 AM
  2. how to record dates when cell is highlighted by colour
    By dougers1 in forum Excel General
    Replies: 19
    Last Post: 09-16-2014, 09:32 AM
  3. [SOLVED] Excel formula to return a cell column and row heading
    By NVRensburg in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-31-2014, 04:09 AM
  4. Excel 2007 : Autofilter Colour Heading Cell with filter
    By ziggadebo in forum Excel General
    Replies: 1
    Last Post: 02-18-2011, 03:36 AM
  5. Formula to return column heading dependent on number in cell
    By Reidm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2008, 05:04 AM
  6. Formula to Return Column Heading
    By den4673 in forum Excel General
    Replies: 4
    Last Post: 02-13-2006, 06:00 PM
  7. [SOLVED] How do you change the default colour a cell is highlighted in?
    By CMorris in forum Excel General
    Replies: 0
    Last Post: 12-14-2005, 06:50 AM

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