+ Reply to Thread
Results 1 to 8 of 8

Referencing cell color fill in formulas

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Referencing cell color fill in formulas

    Before I even say anything, my skillset is way below most of you guys. I'm here to learn so be easy on me...

    I have a table of data where the cells contain financial data and are color filled for different vendors.

    First, I need a way to get a percentage of each color fill out of the total (each row), ignoring the data contained in the cells.

    Second, I need a way to sum the values and group it into buckets corresponding to the color fill.

    If I need to do the color fill and financials in separate cells, that's ok, I just need those two end results.

    I imagine its a series of If/Then statements, but again my skillset is pretty lacking in that regard.

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    365
    Posts
    495

    Re: Referencing cell color fill in formulas

    Are the color fillings done manually or with conditional formatting based on another cell range?

  3. #3
    Registered User
    Join Date
    08-02-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Referencing cell color fill in formulas

    Color fill will be done manually.

  4. #4
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    365
    Posts
    495

    Re: Referencing cell color fill in formulas

    Hmm I'm not sure if it's possible to find certain formatting without using VBA, so let me suggest an alternative solution:

    Instead of manually filling the cells with colors, create an additional column in which you type the vendor's name.
    With conditional formatting you can now automatically give the financial data cell a color based on the vendor (tell me if you need help with this).
    Now you van use the added column to calculate the percentages you want:
    =COUNTIF([vendornames range]="[specific vendor name]")/COUNTA[vendornames range]*100

    The second problem can now be solved with the SUMIF function:
    =SUMIF([vendornames range];[specific vendor name];[summation range]

    Please let me know if you get it and if it works

  5. #5
    Registered User
    Join Date
    08-02-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Referencing cell color fill in formulas

    Tricky part with that is there would need to be 16 columns as I have 8 different groups of 2 cells that can each be filled with one of 4 colors...

    I was trying to get away from manually typing in each cell and wanted to use the color to indicate the vendor.

  6. #6
    Registered User
    Join Date
    08-02-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Referencing cell color fill in formulas

    ok, so now i have it set up where i can input the vendor and conditional formatting will color fill the cells accordingly.

    now, how do i get the same color fill to carry over to the adjacent table where financial data goes? then use that to total the amount of a given color across the row and give what percentage each color is out of the sum all columns in the row?

  7. #7
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    365
    Posts
    495

    Re: Referencing cell color fill in formulas

    Ok. You don't have to color the vendor names themselves with conditional formatting by the way, but it's ok if you already did.

    Let's first focus on coloring the financial data:
    Say the column with vendor data is column A and next to it, in column B, are the related vendor names.
    Select the whole column A and click conditional formatting.
    Use a formula, being =B1="John" (don't select cell B1, just type it).
    Then choose the color for filling the cells and click OK. Now the cells in column A that have "john" next to it in column B should be filled.
    You can create extra conditional formatting rules to do the same for the other vendors.

    Secondly, using column B you can calculate the percentage of John's name appearing in the list (your original first problem).
    In the cell where you want this percentage, type =COUNTIF(B1:B100;"john")/COUNTA(B1:B100)*100
    That's your percentage!

    For your second problem you want to sum the financial data per vendor, right?

    Sorry I have to go, I'll finish my post later. You can already try the first 2 things.
    When I say semicolon, u say comma!

  8. #8
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    365
    Posts
    495

    Re: Referencing cell color fill in formulas

    I'm back already!

    For the last part, use this formula: =SUMIF(B1:B100;"John";A1:A100)

    Wow I could have typed this just as fast as I typed the last sentence in my previous post...

+ 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. change fill color of a range of cells based on color of a cell?
    By DarMelNel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 04:48 PM
  2. How to color-fill blank cells, then once data is entered cell is no-fill
    By hatemail13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 07:57 PM
  3. Replies: 0
    Last Post: 09-26-2012, 01:08 PM
  4. Replies: 3
    Last Post: 07-08-2010, 06:48 PM
  5. Replies: 0
    Last Post: 04-06-2009, 04:07 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