February 15, 2021
Hi
I have large data monthly basis.
When I change filter by cell color (Blue) values above the Monthly header changes. The values changes again when I change filter by cell color to black. Once again values changes again as total when no filter applied.
What I want:
I wants to copy the values on another sheet for each color when I change filter.
So, If I apply blue filter then values need to be copied to another sheet to specific range
then, when I apply filter by black cell color the values need to be copied to another same sheet as previous to specific range.
also do the same for total values.
Please see the attachment.
July 16, 2010
Hi Andy,
Excel doesn't work like that. It's not able to detect cell fill colours with formulas. In the attached file I've used INDEX & MATCH to lookup the values for the codes in column C. The total is simply a sum of the two values.
Maybe this is close to what you're after, but if not, please provide another workbook with a more complete example of your data so we can understand the full picture.
Mynda
February 15, 2021
Hi Mynda
Thank you for the reply However, thats, not what I am after. I have over 1500 rows on sheet one. So When I apply the filter The values changes at range F3:Q3 I have two filter that filters the data based on cell color.
So, ALL i want the values to be extracted to sheet 2 at specific range from sheet 1 range F3:Q3
Please advise!
Thank you
July 16, 2010
Hi Andy,
Like I said, Excel can't detect cell fill colour and use that as a way to extract data...unless it's in a PivotTable and the format of your data doesn't currently support that, or you have the skills to write some complex VBA, so let's try and find an easier way to give you what you want.
First, I need to understand how the fill colour is being determined. If we can understand this logic then I can help you with a formula or PivotTable that replicates this logic. what's not clear from your example is you say you have 1500 rows, so is it possible there will be multiple results for each fill colour, or only ever one line for each i.e. fill colour is applied to each code contained in the column D and there are no duplicates.
Can you please provide a larger example that clearly illustrates whether you have duplicates and explain the logic behind how the fill colour is being applied. Also please advise what version of Excel you're using so we know what tools you have available to you.
Mynda
February 15, 2021
Hi Mynda
I have attached the original spreadsheet that may give you more information to determine what I am looking for.
I am filtering data in column B via two colors. There are certain financial code names listed in column G which get filtered when filter color changes.
All I want Filter results to be copied to another sheet. So if I am filtering data in column B via grey color the result in range V4 TO AG4 changes but when I change filter color in column be to dark grey the result in V4 TO AG4 changes again.
And I want both filtered results to be copied to another location at different row.
So, once again: If I am filtering via grey color in column B the result in range V4 TO AG4 changes which I wants to copy to another sheet say at range C4
and if I am applying Dark grey filter the results changes again at range V4 TO AG4 which I now wants to copy and paste on another sheet as above but at range C5.
I hope it make sense.
VIP
Trusted Members
December 7, 2016
Hello,
What is the logic behind these colours? Why do some cells get dark grey and others light grey and some no colour at all? These colours are set manually.
As Mynda already stated twice, Excel can't check the colours, VBA can. So if you don't want to go with a VBA solution then you need to use something else to filter by, text or number or a combination of both (which will be text). But if you want the copying of data to be automated then of course you are looking for a VBA solution.
Br,
Anders
February 15, 2021
Hi Anders
Actually there is logic. There are specific names in Column G that are filtered when I apply Light Grey filter in Column B. AND There are specific names in Column G that are assigned to Dark Grey color when I apply dark grey filter in column B.
yes! I understand formula cannot be applied to color cell. all I want is to copy the values from range V4 TO AG4 when I apply different filter via color in column B. But i am not index matching anything I just want the values to be copied to another sheet when I apply each filter.
So, When you apply eg: filter via one of both color in column B the values changes at range V4 TO AG4 because with those values i wants to create a chart.
Please help I couldn't find any solution on Uncle Google at all. and I need your expert help.
Thank you both
July 16, 2010
Hi Andy,
Thanks for sharing your file, however I cannot access it as I don't have permission.
The reason you aren't finding the answers in Google is because your approach is not in line with how Excel works. You need to take a step back and stop thinking of filtering taking place based on a colour, because before you could decide what colours to apply you had to have some logic around how to assign those colours, and it's that logic that we need to understand in order to help you.
You hinted at it in so far as saying there are specific names in column G that are filtered when you choose light grey etc., but we'd need to know that logic in order to use it to give you what you want. i.e. what are the list of names and how do they map to the colours.
That said, what I can see of your file, I can tell that it's not in the correct tabular layout that will help you achieve this easily using the built in tools available in Excel. If it were in a tabular layout, you could create a PivotTable from the data and use Slicers to filter the data based on your codes in column G and have that PivotTable automatically create a Pivot chart that updates upon new selections in the Slicer. Sounds complicated, but it's actually very easy.
Personally, I recommend you use Power Query to unpivot your data and load this unpivoted copy to another sheet, or direct to a PivotTable if you have Microsoft 365, and use Slicers to allow your users to automatically filter the data based on the codes.
I hope that points you in the right direction. If you don't like that idea, then you'll have to write some VBA code to do what you want.
Mynda
July 16, 2010
Hi Andy,
Please start a new thread in the VBA forum. Note that there is no guarantee you'll get someone to do this for you as the forum isn't a free consulting service, it's a support service designed to help you if you get stuck trying to create the VBA yourself.
Mynda
VIP
Trusted Members
December 7, 2016
Hello,
You can of course record the steps and let Excel create the code.
How to record a macro in Excel
Br,
Anders
1 Guest(s)