+ Reply to Thread
Results 1 to 14 of 14

Get values from colored cells

  1. #1
    Registered User
    Join Date
    07-16-2021
    Location
    Pretoria
    MS-Off Ver
    2016
    Posts
    12

    Get values from colored cells

    Hi everyone

    I hope someone can assist me.

    I would like to get a formula that will give me values only of specific cells that are colored. For example, an IF statement entered into cell B1, that will give me the value entered into cell A1 only if A1 has a background fill. I would like to then extend this formula for the whole B column.

    I hope it makes sense and that there is a formula for this problem.

  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,869

    Re: Get values from colored cells

    Welcome to the forum.

    How have they been coloured? If there is a logic, then it can be done (but NOT using the cell's colour). If this is ENTIRELY manual, then you'll have to use VBA.

    So, more information, please!

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    07-16-2021
    Location
    Pretoria
    MS-Off Ver
    2016
    Posts
    12

    Re: Get values from colored cells

    Hi Ali

    Thank you so much for getting back to me so soon. I really do appreciate it.

    I have attached a sample of the spreadsheet I am working on. I have entered a very basic "IF" statement in brackets explaining what I would like to do.

    I think it will definitely require VBA, but I am far from an expert.

    I hope this is a bit more clearer.

    Thank again Ali.
    Attached Files Attached Files

  4. #4
    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,869

    Re: Get values from colored cells

    In order to know, you need to tell me WHY those yellow cells are yellow - why have they been highlighted? What's the logic?

    It's not the calculation itself that is the issue.

    If, instead of highlighting, you added a column and placed an X next to the ones you want to calculate, then this would be easy peasy, of course.
    Last edited by AliGW; 07-16-2021 at 06:08 AM.

  5. #5
    Registered User
    Join Date
    07-16-2021
    Location
    Pretoria
    MS-Off Ver
    2016
    Posts
    12

    Re: Get values from colored cells

    Oh ok, no it is completely manual. Those cells are yellow because those are our rental units that are empty. So now I need to calculate the total commission value of all units, but excluding the empty (yellow highlighted) units.

  6. #6
    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,869

    Re: Get values from colored cells

    OK - you have two simple choices:

    1. Instead of highlighting, add a helper column:

    Excel 2016 (Windows) 32 bit
    B
    C
    D
    E
    2
    RENT [R]
    COM [%])
    EMPTY?
    3
    6690.00
    8.0%
    535.2
    4
    6290.00
    8.0%
    Y
    0
    5
    5000.00
    8.0%
    400
    6
    5980.00
    8.0%
    478.4
    7
    5590.00
    8.0%
    447.2
    8
    5990.00
    8.0%
    479.2
    9
    5000.00
    8.0%
    400
    10
    6990.00
    8.0%
    559.2
    11
    6690.00
    8.0%
    535.2
    12
    7290.00
    8.0%
    583.2
    13
    6950.00
    8.0%
    556
    14
    6950.00
    8.0%
    556
    15
    7190.00
    8.0%
    575.2
    16
    5690.00
    8.0%
    455.2
    17
    7490.00
    8.0%
    599.2
    18
    9390.00
    8.0%
    751.2
    19
    6990.00
    8.0%
    559.2
    20
    7390.00
    8.0%
    591.2
    21
    7690.00
    8.0%
    615.2
    22
    6990.00
    8.0%
    559.2
    23
    8490.00
    10.0%
    849
    24
    8590.00
    10.0%
    859
    25
    8290.00
    10.0%
    829
    26
    8290.00
    10.0%
    829
    27
    7990.00
    10.0%
    799
    28
    6490.00
    10.0%
    Y
    0
    29
    6490.00
    10.0%
    649
    30
    3990.00
    10.0%
    399
    31
    3990.00
    10.0%
    399
    Sheet: 2022 EIENAARS

    Excel 2016 (Windows) 32 bit
    E
    3
    =IF(D3="Y",0,B3*C3)
    Sheet: 2022 EIENAARS

    2. Use VBA - if this is your referred option, I can't help, but will move your thread to the correct section.

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Get values from colored cells

    So, if it is manually coloured then you have to run manually macro after finish colouring.
    Try this:
    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 07-16-2021 at 06:20 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  8. #8
    Registered User
    Join Date
    07-16-2021
    Location
    Pretoria
    MS-Off Ver
    2016
    Posts
    12

    Re: Get values from colored cells

    The helper column will have to be done manually hey? I think I will definitely follow that method for now while I am still trying to get ahead of VBA.

    Thank you so much for your assistance, I really do appreciate it Ali.

    Have a great day

  9. #9
    Registered User
    Join Date
    07-16-2021
    Location
    Pretoria
    MS-Off Ver
    2016
    Posts
    12

    Re: Get values from colored cells

    I will try this thank you so much Kokosek. Will let you know if I manage to get it right!!

  10. #10
    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,869

    Re: Get values from colored cells

    The helper column will have to be done manually hey?
    Yes, but your formatting has been done manually - is there any material difference? I am suggesting you use the helper column INSTEAD of the formatting. You could always add conditional formatting based on the helper column to highlight the cells so that they stand out, but this is not about that - it's about making your calculation possible.

    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.

  11. #11
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Get values from colored cells

    As I understand from your note in original sample
    "=If(cell C3 is yellow, then reflect the value of B3*C3 here, if not,0)"
    yellow should determine multiplying, so if you decide to use formulas as AliGW advised, you have to change it into:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    as it originally do oppositely.

  12. #12
    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,869

    Re: Get values from colored cells

    Good spot, however:

    So now I need to calculate the total commission value of all units, but excluding the empty (yellow highlighted) units.

  13. #13
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Get values from colored cells

    So this (what I've focused on)
    "=If(cell C3 is yellow, then reflect the value of B3*C3 here, if not,0)"
    is incorrect then.
    So, main part change into:

    Please Login or Register  to view this content.

  14. #14
    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,869

    Re: Get values from colored cells

    Thanks for the rep.

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

+ 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. Extracting Values from colored cells
    By halfsparrow in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-26-2021, 02:24 AM
  2. Macro that copies as values only the data in the colored cells
    By katamata in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-09-2020, 10:33 AM
  3. Replies: 4
    Last Post: 01-19-2016, 10:24 PM
  4. Replies: 1
    Last Post: 11-09-2013, 02:43 AM
  5. Please help! Counting values in specific colored cells
    By dilemmax in forum Excel General
    Replies: 3
    Last Post: 02-08-2013, 01:13 PM
  6. summing the values in only the colored cells
    By CRANEGURU in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 04:05 PM
  7. Have blocks of blue colored cells ... want them surrounded by lavender-colored cells
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2007, 03:59 PM

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