How sparklines deal with non-numeric values in Excel

2 years ago 313

Sparklines are tiny charts that acceptable into a azygous Microsoft Excel cell. But if you're tracking non-numeric data, they tin grounds weird behavior. Learn however to debar problems erstwhile utilizing sparklines.

excel-sparklines.jpg

Image: Paul Barnwell/Shutterstock

Sparklines successful Microsoft Excel are charts—tiny small charts that show inline with the information due to the fact that they acceptable into a cell, usually adjacent to the information they're evaluating. With a speedy glance, not lone tin you larn astir a azygous entity, but you tin comparison that entity to others. They're large successful dashboards, but their existent spot is successful their simplicity. They are ace casual to implement; you get a batch for small effort. Sparklines illustration numeric information arsenic you mightiness expect. They tin grip non-numeric information erstwhile it creeps in, but viewers mightiness not recognize however the sparklines correspond those values. In this article, I'll amusement you however sparklines grip non-numeric information and a fewer fixes for those instances.

SEE: 83 Excel tips each idiosyncratic should master (TechRepublic)

I'm utilizing Microsoft 365 Excel (desktop) connected a Windows 10 64-bit system, but this diagnostic is disposable backmost to Excel 2010. You tin enactment with your ain information oregon download the objection .xlsx file. You tin show sparklines successful the browser, but you can't make oregon modify them. This nonfiction assumes you person basal Excel skills, but adjacent a beginner should beryllium capable to travel the instructions to success.

If you're not acquainted with sparklines, you mightiness privation to work How to crook mean sparklines into meaningful accusation with a fewer elemental formats. You'll larn however to make and format them.

How sparklines crippled values successful Excel

Sparklines measure numerical information and arsenic we each cognize (all excessively well), sometimes determination are different values different than non-numeric. We don't ever expect them, truthful we neglect to program for them. In this case, determination should astir apt beryllium nary non-numeric values successful your information set. My proposal earlier you adjacent start, is to cleanable up your data, but that's not ever practical. When you can't enactment with a pristine information set, you request to cognize however sparklines grip values different than numbers:

  • A implicit acceptable of numeric values creates a connected enactment with a information constituent astatine each value.
  • An mistake worth is ignored (no information point).
  • Blanks permission gaps successful the sparkline.
  • Zero values are plotted.
  • Data successful hidden rows oregon columns are ignored, but you tin reset that default option.

Now, let's spot these rules successful place.

When non-numeric values are portion of the information set, sparklines volition correspond them successful assorted ways. Figure A shows a elemental information acceptable with blanks, zeros and errors. As you tin see, the sparklines don't amusement immoderate benignant of alerting error, and viewers astir apt won't recognize what they see. (What I deliberation unusual is that the sparkline successful H5 plots the substance successful C5 astatine 0; I would expect the sparkline to disregard the substance worth by leaving a gap.)

Figure A

excelsparklines-a.jpg

  These sparklines don't entity to non-numeric values, but the mode Excel plots them mightiness confuse users.

Let's instrumentality a look astatine each record: 

  • James illustration is fine; each evaluated values are numeric. 
  • Luke has an error, which the sparkline ignores. You tin archer due to the fact that there's nary marker. If markers aren't enabled, you mightiness miss that completely. To spot markers, click the Sparkline tab and cheque the option. 
  • Martha has substance successful the archetypal cell, which the sparkline plots arsenic 0. For me, this is the lone failing for this feature. To beryllium consistent, the sparkline should disregard it. 
  • The bare compartment for June is wholly ignored; the sparkline doesn't adjacent link the lines!
  • Rosa's bare compartment is besides ignored, but due to the fact that it's astatine the opening of the line, you mightiness not announcement it, particularly if determination aren't different sparklines. 
  • Like James, Nick's sparkline is successful tact due to the fact that each of his values are numeric. 

SEE: Windows 10: Lists of vocal commands for code designation and dictation (free PDF) (TechRepublic)

If you don't cognize however to make the sparklines, bash the following:

  1. Select H3:H8, the determination of the sparklines. Alternatively, you don't person to prime the scope before; you tin bash truthful later. It's lone a choice.
  2. Click the Insert tab and click Line successful the Sparklines group.
  3. In the resulting dialog, specify the worth scope and the determination scope (H3:H8).
  4. Click OK.

That's it! If you don't similar the mode sparklines crippled these non-numeric values, you person options.

Changing default settings

If you don't similar the mode the sparklines crippled non-numeric values by default, you tin revamp the data. 

First, let's woody with the blanks. If you truly don't cognize the value, 0 seems due enough. It isn't the aforesaid happening a a existent blank, but arsenic a wide rule, it's amended than leaving the cells blank. To marque this alteration quickly, bash the following:

  1. Select the range, C3:G8.
  2. Click F5 and past click Special successful the resulting dialog.
  3. In the adjacent dialog, click the Blanks enactment (Figure B).
  4. Click OK and instantly participate a 0.
  5. Without clicking oregon pressing thing else, property Ctrl + Enter to participate 0 successful each blank cells successful the selected scope (Figure C). As you tin see, the blank cells present incorporate 0 and the sparklines crippled them.

In specified a elemental information set, you could easy participate the 0s manually, but that won't ever beryllium the case.   

Figure B

excelsparklines-b.jpg

  Use this diagnostic to prime each the blank cells successful the selected range. 

Figure C

excelsparklines-c.jpg

  This is simply a speedy mode to participate 0 successful each blank cells.

Next, let's woody with the #N/A value. It's truly a manually entered #N/A mistake value. But the champion mode to woody with it is to hole the error. In this contrived illustration of course, determination is nary fix. Simply regenerate it with a valid numeric value, adjacent 0. Any worth volition do, but Figure D shows a replacement worth of 0.

Figure D

excelsparklines-d.jpg

  Fix errors truthful the sparklines tin crippled the existent values.

To find each mistake values, usage the Go To Special diagnostic again. Look for the Formulas option, and prime Errors. 

At this point, you could stop. All the sparklines are plotting each the values, including the substance worth successful C5, which the diagnostic plots astatine 0. However, the substance worth is incorrect successful astir immoderate setting. Because we're not dealing with null values arsenic a morganatic value, it would beryllium champion to participate 0 than permission the text—in my opinion—unless you person a bully crushed to permission it. If you do, beryllium forewarned that doing truthful mightiness effect successful erroneous results successful functions and expressions. 

Stay tuned

There's much than 1 mode to find mistake values successful a information set, and successful an upcoming article, we'll reappraisal them. 

Microsoft Weekly Newsletter

Be your company's Microsoft insider by speechmaking these Windows and Office tips, tricks, and cheat sheets. Delivered Mondays and Wednesdays

Sign up today

Also see

Read Entire Article