+ Reply to Thread
Results 1 to 3 of 3

Chart to show date differences with blanks in data

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Victoria, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Chart to show date differences with blanks in data

    Good morning,

    I have a worksheet with a list of records. I have calculated the difference between the date record released and date record received. I need to create a chart that shows a summary of dates over 30 days, over 14 days, over 7 days, and less than 7 days. I would also like to have a chart that shows open records that have not been released and have it summarized by the same time periods.

    Can anyone help me with that? Sample worksheet attached.

    Thank you,
    Brooke
    Attached Files Attached Files

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

    Re: Chart to show date differences with blanks in data

    The Attached worksheet should work for you.

    The first thing I did was to convert your basic data into an Excel Table. Excel Tables have many advantages. Some of them are:
    • They "know" how big they are so formulas, pivot tables and charts built on them react automatically when the table data grows or shrinks
    • As new data are added, they automatically become part of the table
    • Tables automatically "copy down" formulas, formats and validations.
    • They "remember" formulas. If you empty out this table and put in new data, the formulas return
    • Formulas are expressed in terms of header names rather than cell references which make them easier to understand and debug. This even works in VB!
    I suggest you do a web search on Excel Table Tutorial. They are worth learning.

    I modified and added formulas

    Column F is =IF(ISBLANK([@[Date Released]]),NA(),[@[Date Released]]-[@[Date Received]]) -- this gives the difference between received and closed date or blank if it's still open.
    Column G is =IF(ISBLANK([@[Date Released]]),TODAY()-[@[Date Received]],NA()) -- this calculates the number of days open for still open items.

    The #NA keeps the formulas in the bucket calculations from calculating.
    Column H is =XLOOKUP([@[Closed Date Difference]],Table2[Days],Table2[Buckets],"Over 30",1)
    Column I is =XLOOKUP([@[Open Date Difference]],Table2[Days],Table2[Buckets],"Over 30",1)

    I'll explain XLOOKUP below. First of all, this explains all: https://www.howtogeek.com/439286/how...crosoft-excel/.

    The lookup sheet contains a table for the buckets. The first two columns are used to look up the buckets, then next two have formulas for the data for the plots.

    Here is one of the XLOOKUP formulas again: Column H is =XLOOKUP([@[Closed Date Difference]],Table2[Days],Table2[Buckets],"Over 30",1)

    XLOOKUP takes a number of parameters but the first couple are:
    - Look for this
    - In this column
    - Return the value found in this column
    - What to do in case of an error
    - What kind of a match do I want

    So we look for the value found on the current line in the column labled Closed Date Difference (the @ means "look at this line")
    Try to find it in the Days column in Table2
    Return the matching value in the Buckets column in Table2 (No @ and just brackets means look at the whole column)
    If there is an error, show the string "Over 30"
    The 1 means look for an exact match and if you don't find it go back to the next highest value

    For example, if 16 is entered, there isn't an exact match. The next highest value in the days column is 30, so use the bucket associate with that value.

    If 45 is entered, there is NO next higher value. So there is an error. According to the formula, if there is an error show "Over 30"

    I just noticed that you have Excel 2010 - you have tables, you may or may not have XLOOKUP. If you do not, then the formula obviously will not work. We can accomplish the same thing with MATCH and INDEX, but the formula becomes more complicated.
    Attached Files Attached Files
    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.

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    Victoria, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Chart to show date differences with blanks in data

    I came back to reference this post and realized my thank you post did not post. Thank you so much for your help and recommendations! You are amazing for taking the time to explain with that much detail and everything worked like a charm! I'm currently learning all I can about tables!

    Thank you again.

+ 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. Replies: 9
    Last Post: 12-26-2016, 12:33 PM
  2. [SOLVED] Change Formulae to show blanks/no data
    By Keshypops in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2016, 03:36 PM
  3. Replies: 1
    Last Post: 03-09-2015, 07:49 AM
  4. [SOLVED] Removing blanks where blanks show blank but are code to show blank.
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-08-2013, 05:34 AM
  5. Best way to sort and sum dynamic data, compare to other data and show differences
    By williery10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2012, 10:32 AM
  6. Replies: 5
    Last Post: 02-06-2012, 11:29 AM
  7. Replies: 1
    Last Post: 04-26-2008, 08:00 AM

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