Pie chart based on cell colors

nololo Posted messages 2 Status Member -  
Raymond PENTIER Posted messages 58213 Registration date   Status Contributor Last intervention   -
Hello,

I would like to create a "Pie Chart" based on cell colors (each cell counts as 1), let me explain.

In my table, there are cells of different colors (green, red, blue). For example, there are 10 green cells, 28 red cells, and 3 blue cells. (there is also text in these cells)

I want my chart to only consider the colors. In this case, I would like my chart to represent 10% for the green section, 28% for the red section, and 3% for the blue section.

I hope I have been clear enough.

Thank you in advance.

6 answers

  1. Raymond PENTIER Posted messages 58213 Registration date   Status Contributor Last intervention   17 482
     
    nololo,
    you can see that to draw your pie chart, you had to go through the table E4:E7!
    That's exactly what I explained to you, you need numerical data.
    You just have to find a way to determine this data (7, 2, 4, and 1 here).
    The simplest method is to use conditional formatting to apply colors in column B, by putting a code in column D: 1 for green, 2 for yellow, 3 for blue.
    All you need to do is enter 1, 2, 3, 4 in F4:F7
    then the formula =COUNTIF($D$3:$D$999,F4) in E4, to be copied down to E7.
    https://www.cjoint.com/?BKuprEpNZh3
    No macros, simple to adapt, no bugs to worry about, unlimited colors with Excel 2007/2010!

    Best regards.
    --
    Retirement is great! Especially in the Caribbean ... :-)
    ☻ Raymond ♂
    2
  2. ccm81 Posted messages 11033 Status Member 2 434
     
    Hello

    To clarify things, could you send your workbook (in Excel 2003 format) without any confidential data to cjoint.com and include the link obtained in your next message?
    Try to explain:
    - what you want to achieve
    - if the data will evolve
    - etc...

    Best regards
    0
  3. Raymond PENTIER Posted messages 58213 Registration date   Status Contributor Last intervention   17 482
     
    Definition: In Excel, a chart is a drawing that represents numerical data.

    Chart: To obtain the pie chart you want, you need a small auxiliary table, for example "Green" in L5, "Red" in M5, "Blue" in N5, 10 in L6, 28 in M6, and 3 in N6. Select L5:N6 and do Insert/Chart/Sectors.

    Best regards.
    Retirement is great! Especially in the Caribbean ... :-)
    ☻ Raymond ♂
    0
  4. nololo Posted messages 2 Status Member
     
    Thank you for your answers,

    Unfortunately, I fear that what I'm asking for is impossible.

    The second solution (Raymond Pentier) is interesting but it won't save me time and is therefore not useful in my case.

    I created an Excel document that you will find at this link: https://www.cjoint.com/?3Kui5UzlrAw

    In my chart, I would like my pie chart to show 7 greens, 2 yellows, 4 blues, and 4 without color (as in the chart I created manually).

    Unfortunately, the official document being much larger, it is not possible for me to do it this way.

    Best regards,
    0
  5. ccm81 Posted messages 11033 Status Member 2 434
     
    hello

    not impossible, but we'll need to go through a macro

    I'll take a look at that

    see you later
    0