+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting of an Inventory Graph

  1. #1
    Registered User
    Join Date
    07-25-2018
    Location
    Virginia, USA
    MS-Off Ver
    2013
    Posts
    8

    Conditional Formatting of an Inventory Graph

    Hi,

    I am new to the forum, so please excuse any formatting errors.

    I am attempting to visualize language technology inventory data through a graph that will depict both the languages and the technology that language has. However, just as important as what technology the language has, is what technology it doesn't have. I would like the graph to depict (equally) both the null values and the actual values. This becomes important to demonstrate "gaps" in more the common applications. Conditional formatting can be used to depict the null values with a specific fill (theoretically at least). I have attempted this many times (all sorts of graphs), but I can't figure out how to show the null values in equal proportion to the real values. I am attaching a workbook, and the graph is pretty typical of what I generally get.

    In other words...how can I chart every category for each language, even though the value may be null? Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting of an Inventory Graph

    You could use -1 vs 0 for missing
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Formatting of an Inventory Graph

    I think I have something for you, but it requires a bit more testing. I'll post tomorrow.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Conditional Formatting of an Inventory Graph

    You would need to add a new series for each missing technology.

    Use a 100% stacked as the bars all need to be the same size.
    Format all the missing series to be the same colour as the present ones but with a pattern file, or transparency.

    Finally add another series to the secondary axis as column chart in order to label the technologies.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    07-25-2018
    Location
    Virginia, USA
    MS-Off Ver
    2013
    Posts
    8

    Re: Conditional Formatting of an Inventory Graph

    Ben - I experimented with the -1 concept. Unfortunately, it made the chart less intuitive. When you multiply that by all the languages in the world, I think it would be very messy chart. For the record I also toyed with the idea of having it a at 0.5 vs 1, and got the same thing - uneven categories that make you strain to understand what is going on. Thanks though.

  6. #6
    Registered User
    Join Date
    07-25-2018
    Location
    Virginia, USA
    MS-Off Ver
    2013
    Posts
    8

    Re: Conditional Formatting of an Inventory Graph

    Andy,

    That is absolutely brilliant and is working exactly as hoped. I thought it would be a 100% stacked bar, but I couldn't get it working right. I will mark this as solved, but I want to wait for a bit to see if dflak comes up with something different (not sure if marking it solved will prevent future posting). Of course, that is only step 1, now I get to try to visualize it into something "pretty." Thanks!

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Formatting of an Inventory Graph

    As others pointed out, you can't chart what isn't there. If you want equal bars, you need equal values. The attached uses VBA to set the series colors.

    First I converted the data range into an Excel Table called Table_Language. Tables know how big they are, so if you add rows to this table, the chart (which is built on the table) will pick them up automatically. You can also add columns, and I will explain how to do that below.

    I have a helper column in Column G called series. This column has the formula =1. We need equal bars, so we need equal values. The chart, itself, is built from this column. The colors of the bar segments comes from Table_Language.

    On the Series Color sheet, there is a table. Column A is actually irrelevant, but is filled in with explanatory information. If you are going to add a column to Table_Language, you must add a corresponding row to this table.

    Highlight the Cell in Column A and fill it with the color you want for that series. Missing is the color you want to plot if the value in Table_Language is zero. Then assign colors to the other series in the chart by filling the cell with the color you want to use for that series. Column B is calculated for you. It is the color index. Don't change it. This is also an Excel Table called Table_Color. The formula in column B will copy down automatically if you add a new series. If you don't like the colors I've chosen, feel free to fill in with new ones.

    Develop your table of languages and click on the Chart It button.

    You can hide the helper column, Column G. You can also hide the Series Color Sheet.
    Attached Files Attached Files

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Formatting of an Inventory Graph

    Use this version. it has a slight modification that gets the legend to match up with the selected colors.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-25-2018
    Location
    Virginia, USA
    MS-Off Ver
    2013
    Posts
    8

    Re: Conditional Formatting of an Inventory Graph

    dflak - This works as well. I won't pretend to understand VBA, but the result is undeniable (and more importantly exactly what I was hoping for. Thank you for you help.

+ 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. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  2. [SOLVED] Color scale conditional formatting in a bubble graph
    By theletterh in forum Excel General
    Replies: 2
    Last Post: 08-31-2012, 02:03 PM
  3. Multiple Series Conditional Formatting in a Line Graph
    By help_clueless! in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2012, 02:08 PM
  4. [SOLVED] Conditional formatting bar graph with multiple x-axis values
    By akreda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2012, 01:12 PM
  5. Conditional formatting for a chart - Column graph
    By sb_rs in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-05-2009, 10:05 AM
  6. Conditional Formatting a data series in a graph.
    By shantibala in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-26-2009, 05:49 AM
  7. Conditional formatting and Graph question
    By dipsydoodle in forum Excel General
    Replies: 4
    Last Post: 07-30-2008, 02:52 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