+ Reply to Thread
Results 1 to 7 of 7

Interpolate or Fill Line Gaps

  1. #1
    Registered User
    Join Date
    02-04-2022
    Location
    Long Beach, CA
    MS-Off Ver
    Home & Student 2019
    Posts
    6

    Interpolate or Fill Line Gaps

    I have a chart that includes both stock candlesticks and a line. The data have gaps for weekends and holidays. (I want the gaps shown as they are.) The line connects the mean (high+low)/2 for each market day.
    I'd like the mean line to connect through the blank/empty weekends and holidays. Currently the line drops to zero for empty data days. (Open the attached sample.xlsm to see the line drops.)
    The mean is defined by the following, which outputs "" for non-market days:
    =IFERROR((C80+D80)/2,"")
    I've tried Select Data > Hidden and Empty Cells > Connect data points with line, but it doesn't do anything.

    Dell XPS 8940
    Desktop
    Windows 11
    Office Home and Student 2019
    Excel v. 2201 (Build 14827.20158)
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: Interpolate or Fill Line Gaps

    A chart will treat "" as text and text as a datapoint is treated as zero, which is why the line goes to zero.

    use =IFERROR((C2+D2)/2,NA())

    Show empty cells as Gaps AND Show #N/A as an empty cell.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-04-2022
    Location
    Long Beach, CA
    MS-Off Ver
    Home & Student 2019
    Posts
    6

    Re: Interpolate or Fill Line Gaps

    Jackpot!
    Thanks Andy.

  4. #4
    Registered User
    Join Date
    02-04-2022
    Location
    Long Beach, CA
    MS-Off Ver
    Home & Student 2019
    Posts
    6

    Re: Interpolate or Fill Line Gaps

    Just to tidy things up...
    How do I hide the #N/A?
    All of the solutions I'm seeing suggest using IFERROR to change them to zeros, which is what I don't want!

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

    Re: Interpolate or Fill Line Gaps

    Use Conditional formatting to change font to white for cells with Errors.

  6. #6
    Registered User
    Join Date
    02-04-2022
    Location
    Long Beach, CA
    MS-Off Ver
    Home & Student 2019
    Posts
    6

    Re: Interpolate or Fill Line Gaps

    Thanks!
    I solved the problem by using Wite-Out on my screen to cover the ugly cells. 🙃
    (I know... most of you have never used a typewriter.)

    I used the rule “=ISNA(A2:G1884)” sans quotes.

    (One of my biggest problems is using the keyboard cursor arrows to move around inside of certain places. Excel interprets these keystrokes instead of moving the insertion point and messes things up.)

    Your solution worked great. Thanks for all of your help.

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

    Re: Interpolate or Fill Line Gaps

    If you are in a reference box use F2 to toggle between edit and reference

+ 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. Fill the date series through gaps
    By Rajendra_kodavaty in forum Excel General
    Replies: 2
    Last Post: 11-12-2016, 07:25 AM
  2. Line Chart with Gaps.
    By El-d in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-28-2016, 07:29 AM
  3. Maths formulas to fill in the gaps
    By TestMailinator in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-16-2015, 07:02 PM
  4. Interpolate empty cells on a 2-line chart
    By gerryvb in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-05-2011, 05:41 PM
  5. Trying to fill in the gaps
    By MrFletcher in forum Excel General
    Replies: 15
    Last Post: 11-26-2010, 08:19 AM
  6. fill gaps by 0-values
    By spanky84 in forum Excel General
    Replies: 4
    Last Post: 02-13-2010, 07:30 AM
  7. Replies: 1
    Last Post: 09-17-2005, 10:05 AM

Tags for this Thread

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