Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2016, 07:57 PM
lbeck lbeck is offline How can I make a table or chart to interpolate between values? Windows 10 How can I make a table or chart to interpolate between values? Office 2013
Novice
How can I make a table or chart to interpolate between values?
 
Join Date: Jun 2015
Posts: 11
lbeck is on a distinguished road
Default How can I make a table or chart to interpolate between values?

I enjoy looking at the performance of my investments over time (not rich - just like the visual feedback). I have constructed a spreadsheet with daily entries but there are many blank rows where I haven't entered data due to inactivity (either mine or the market).

I use the Excel autofill utility for date. So when I construct a graph I get this ugly sawtooth showing zeros where there is no data. What I would like is a nice smooth line chart that connects only the positive/negative values over time.



How do I do that?

Thanks
Reply With Quote
  #2  
Old 09-30-2016, 08:10 PM
macropod's Avatar
macropod macropod is offline How can I make a table or chart to interpolate between values? Windows 7 64bit How can I make a table or chart to interpolate between values? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There are many possible interpolation algorithms. Perhaps the simplest is a linear one.
Suppose your dates (in ascending order) are in column A and the data are in column B and there are gaps in column B between rows 9 and 19. To generate a linear interpolation for the missing data, you could insert the following formula in B10 and copy down to B18:
=(B$9-B$18)/(A$9-A$18)+B9
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-01-2016, 09:19 AM
lbeck lbeck is offline How can I make a table or chart to interpolate between values? Windows 10 How can I make a table or chart to interpolate between values? Office 2013
Novice
How can I make a table or chart to interpolate between values?
 
Join Date: Jun 2015
Posts: 11
lbeck is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
There are many possible interpolation algorithms. Perhaps the simplest is a linear one.
Suppose your dates (in ascending order) are in column A and the data are in column B and there are gaps in column B between rows 9 and 19. To generate a linear interpolation for the missing data, you could insert the following formula in B10 and copy down to B18:
=(B$9-B$18)/(A$9-A$18)+B9
Thanks for your thoughtful response, but it didn't work for me. Maybe I did something wrong, but tried several times.

Actually, I probably phrased my question incorrectly. I'm looking for a simple solution and don't need interpolation. I was thinking more along the lines of "if a cell is zero or blank, insert previous cell contents." That would keep the line graph from bottoming out and giving the appearance that investments went to zero on the days where there is no data entered.
Attached Images
File Type: jpg SS figure.jpg (103.5 KB, 15 views)
Reply With Quote
  #4  
Old 10-01-2016, 11:30 AM
charlesdh charlesdh is offline How can I make a table or chart to interpolate between values? Windows 7 32bit How can I make a table or chart to interpolate between values? Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

Hi,

Can you just delete the "Blank" cells?
There is a code that will do this.
Reply With Quote
  #5  
Old 10-01-2016, 04:47 PM
lbeck lbeck is offline How can I make a table or chart to interpolate between values? Windows 10 How can I make a table or chart to interpolate between values? Office 2013
Novice
How can I make a table or chart to interpolate between values?
 
Join Date: Jun 2015
Posts: 11
lbeck is on a distinguished road
Default

Quote:
Originally Posted by charlesdh View Post
Hi,

Can you just delete the "Blank" cells?
There is a code that will do this.
Yes I can manually delete blank cells and I've done that in the past. But it's a pain. If there's a function that will do that automatically I'd appreciate a reference to it if it won't disrupt structure (e.g., shifting cells to the wrong date).
Reply With Quote
  #6  
Old 10-01-2016, 04:56 PM
charlesdh charlesdh is offline How can I make a table or chart to interpolate between values? Windows 7 32bit How can I make a table or chart to interpolate between values? Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

HI,

Here's a code that may work. It's a modified version of a code the "NoSpark" created.

Copy and paste to code module.

Code:
Sub DeleteBlank()
'''Modified code that "NoSparks created.
' remove rows with blank in column "B"

With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With


'delete rows where B is blank
Range("B1", Cells(Rows.Count, "B").End(xlUp)).SpecialCells(xlBlanks).EntireRow.Delete

With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
End With

End Sub
Test a a copy of your data.

Last edited by charlesdh; 10-01-2016 at 05:06 PM. Reason: removed text
Reply With Quote
  #7  
Old 10-02-2016, 11:18 AM
charlesdh charlesdh is offline How can I make a table or chart to interpolate between values? Windows 7 32bit How can I make a table or chart to interpolate between values? Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

Hi,

I erred on the previous code posted. The following code should work.

Code:
Sub DeleteBlank()
' remove rows with blank in column "B"

With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With


For Each cell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
If Cells(cell.Row, 2).Value = "" Then
    Cells(cell.Row, 2).EntireRow.Delete
End If
Next
With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
End With

End Sub
Reply With Quote
  #8  
Old 10-03-2016, 12:37 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline How can I make a table or chart to interpolate between values? Windows 7 64bit How can I make a table or chart to interpolate between values? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

@lebeck
Hello
please do not quote entire posts unnecessarily. They are just clutter and make the thread hard to read.
Thanks
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I make a ScrollBar &/or a SpinButton display values? jeffk Excel 3 01-04-2016 04:25 AM
How can I make a table or chart to interpolate between values? Format Chart X axis - inconsistent values TimTDP Excel 2 12-01-2015 02:56 AM
How can I make a table or chart to interpolate between values? Is it possible to make such chart in Word? am0 Word 3 12-12-2014 02:13 AM
How can I make a table or chart to interpolate between values? Generate chart from list of text values knownunknown Excel 6 04-24-2013 01:56 AM
Word chart with words for y-values? Computerbum Office 0 09-19-2011 07:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft