+ Reply to Thread
Results 1 to 9 of 9

IF Statement based on font color in a cell

  1. #1
    Registered User
    Join Date
    09-14-2017
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365 version 2202
    Posts
    46

    IF Statement based on font color in a cell

    Hi there, at work I export files to excel from a database called Anaplan. Some of the values in the export have blue font.

    I need to do an IF statement based on the font color in cells - i.e. if that row contains any cells with blue font then give me this, if not (i.e. if that row only contains cells with black font then give me that.

    Please see attached.

    Can it be done without VBA?

    I have Office 365.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: IF Statement based on font color in a cell

    Can it be done without VBA?
    Short answer: No.

    Long answer: Colour is not data, so no.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,451

    Re: IF Statement based on font color in a cell

    You could use GET.CELL , which is a little difficult to master..

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: IF Statement based on font color in a cell

    I can't get CELL or GET.CELL to work. Perhaps someone can post an example?


    This function seems to work.

    Courtesy: https://www.sulprobil.com/sbgetcell_en/


    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,009

    Re: IF Statement based on font color in a cell

    Get.Cell must also be saved into .xlsm

    An example like this,

    1. create sheet2 tab.
    2. Ctrl+F3, New
    3. Name: getColor Refers to:=GET.CELL(24,Sheet1!A1)
    4. sheet2!A1 =getColor
    5. copied down and across.
    6. sheet1!E2 =IF(COUNTIF(Sheet2!B3:C3,5)>0,"Anaplan","DCRM")
    7. copied down.
    Attached Files Attached Files

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,451

    Re: IF Statement based on font color in a cell

    This also seems to work with GET.CELL but 4.0 macros have to be enabled via the Trust Center
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-14-2017
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365 version 2202
    Posts
    46

    Re: IF Statement based on font color in a cell

    Thanks everyone but I was shown another way to isolate the blue font projects in the program the data came from (Anaplan)! I'm still learning macros so struggled with some of the above. I'll revisit this post though and when not so busy and try to work it out! Thanks again

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: IF Statement based on font color in a cell

    You're welcome. Thanks for the rep.

  9. #9
    Registered User
    Join Date
    08-31-2023
    Location
    nantes
    MS-Off Ver
    office 360
    Posts
    4

    Re: IF Statement based on font color in a cell

    /......../
    Last edited by L0renz; 08-31-2023 at 11:01 AM. Reason: error ... wrong thread

+ 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] Can an IF statement is based on font color ?
    By davidtips0214 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-23-2023, 07:35 AM
  2. Change cell format (cell color+font color) based on color of another cell
    By Dedaluss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2017, 03:27 AM
  3. How to get the Value of Cell based on font color
    By 1man in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-11-2014, 04:28 AM
  4. Change Font Color Based On Adjacent Cell Color
    By Zorro9758 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2013, 02:47 PM
  5. Change font color based on font color of another cell
    By Ibyers in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 09:36 AM
  6. change font color based on cell value
    By herukuncahyono in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-03-2010, 03:34 AM
  7. How to sum data based on font or cell color?
    By techiesol in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-24-2006, 11:11 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