+ Reply to Thread
Results 1 to 11 of 11

What formula will pick the value from the colored font cell?

  1. #1
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    What formula will pick the value from the colored font cell?

    Hi.

    I need your help.

    In the attachment there is a small spreadsheet.

    I need two formulas/rules in Sheet1:

    1) If in column F and G the value is #N/A the formula has to change it to 0.

    2) In column H in each cell has to be the value only from colored font cell from columns A,B,C,D (same row).

    The result should be:



    Cell H2 5.00

    Cell H3 7.00

    Cell H4 10.00

    Cell H5 7.00

    Cell H6 5.00

    Cell H7 5.00

    Cell H8 6.00

    ....
    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,916

    Re: What formula will pick the value from the colored font cell?

    Welcome to the forum.

    Try this for your first issue:

    =IFNA( your_formula , 0)

    The other issue can't be resolved with a formula, sorry. Formulae cannot 'see' formatting.
    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
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: What formula will pick the value from the colored font cell?

    You forgot to $ the references for the VLOOKUPS. They should be:

    =IFERROR(VLOOKUP(E2,Sheet2!A:B,2,FALSE),0)

    and

    =IFERROR(VLOOKUP(E2,Sheet2!C:D,2,FALSE),0)

    It is possible... sort of... to select cells by font colour, but is requires VBA and is a bit messy. HOW are the font colours set? Is there a rule... or is it done manually with no pre-determined rules??
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: What formula will pick the value from the colored font cell?

    You can use these formulae for part 1 of your questions:

    F2: =IFERROR(VLOOKUP(E2,Sheet2!$A$1:$B$102,2,FALSE),0)

    G2: =IFERROR(VLOOKUP(E2,Sheet2!$C$1:$D$102,2,FALSE),0)

    For part 2, you have used a background colour for columns A to D, with a varying foreground colour - I presume you mean "not a black foreground colour". I also presume that you set these different foreground colours manually, as there are no conditional formatting rules in evidence. Anyway, a formula cannot directly detect the foreground colour, as that is to do with formatting (it is not a "value" in Excel).

    Is there any logical reason for the different foreground colours being set? If so, then conditional formatting could be used, and the same rule(s) could be used within a formula to return the appropriate result.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    Re: What formula will pick the value from the colored font cell?

    manually

    Thank you

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: What formula will pick the value from the colored font cell?

    You didn't really answer the Q about the colour. Is the choice of cells to be coloured subject to a RULE that we can exploit... or is it a bit random?

  7. #7
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    Re: What formula will pick the value from the colored font cell?

    thank you, that works

  8. #8
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    Re: What formula will pick the value from the colored font cell?

    Sorry. It's random, I do it manually.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: What formula will pick the value from the colored font cell?

    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Then use:

    =SUM(IF(GetCellFontColor(A2:D2)<>0,A2:D2,""))

    copied down.

    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    Re: What formula will pick the value from the colored font cell?

    thank you Pete. You are right with "not a black foreground colour" and with "that I set these different foreground colours manually".
    Each background colour is a vendor.
    Each foreground colour is a price of in-stock product. Red - price is too high, Green - price is ok.
    Each foreground black colour is a price of out of stock product.

    So I need formula to pick the colored price from the row and from 4 columns.

  11. #11
    Registered User
    Join Date
    01-17-2022
    Location
    USA
    MS-Off Ver
    Excel for Mac, version 16.51
    Posts
    6

    Re: What formula will pick the value from the colored font cell?

    Thank you Glenn. It works!!! Thank you so much.

    Best regards,
    Arthur

+ 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. How to have excel count colored font?
    By jkskates in forum Excel General
    Replies: 7
    Last Post: 10-23-2012, 01:44 PM
  2. Replies: 4
    Last Post: 04-05-2012, 04:07 AM
  3. [SOLVED] I need to use a formula to pick up a value by the font color?
    By Harshad in forum Excel General
    Replies: 1
    Last Post: 01-27-2006, 09:10 AM
  4. Can you sort a column in Excel that's different by colored font?
    By JHoleman1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. Can you sort a column in Excel that's different by colored font?
    By JHoleman1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  6. [SOLVED] Can you sort a column in Excel that's different by colored font?
    By JHoleman1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  7. [SOLVED] Can you sort a column in Excel that's different by colored font?
    By JHoleman1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  8. Can you sort a column in Excel that's different by colored font?
    By JHoleman1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

Tags for this Thread

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