+ Reply to Thread
Results 1 to 17 of 17

Trend data points

  1. #1
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    Thumbs up Trend data points

    What I have is a column (column A) that only has two data entries at any one time.
    I need column B to fill in the trend of those two data points.
    My problem is I don't know how to deal with the cells that say #N/A. Which is every cell other than the two cells with data.
    If I replace the #N/As with say 1, then it messes up the trend data points.
    It seems like I need to be using the trend command, but any solution would be welcome.
    Thanks.
    A B
    1 #N/A 12
    2 #N/A 11.5
    3 #N/A 11
    4 #N/A 10.5
    5 #N/A 10
    6 #N/A 9.5
    7 9 9
    8 #N/A 8.5
    9 #N/A 8
    10 #N/A 7.5
    11 #N/A 7
    12 #N/A 6.5
    13 #N/A 6
    14 #N/A 5.5
    15 #N/A 5
    16 4.5 4.5
    17 #N/A 4
    18 #N/A 3.5
    19 #N/A 3
    20 #N/A 2.5
    21 #N/A 2
    22 #N/A 1.5
    23 #N/A 1
    24 #N/A 0.5
    25 #N/A 0
    26 #N/A -0.5
    27 #N/A -1
    28 #N/A -1.5
    29 #N/A -2
    Attached Files Attached Files
    Last edited by 173; 12-23-2008 at 01:06 PM. Reason: To clarify problem, added attatchment

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    I know that sounds clear to you, but we need you to upload a sample book showing some sample data and sample results you expect to see. Highlight the cells that are problematic, much clearer than trying to describe it long form.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Just a suggestion,

    Try this,

    IF(ISNA(Insert your formula here),"",Insert your formula here)

    this formula will return a blank cell instead of #N/A

    HTH
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  4. #4
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    help trending

    ratcat,

    Your suggestion works well for getting rid of the #N/A's, but I don't know how to get the trend that is shown in column B.

    JBeaucaire,

    I went ahead and added your suggestions to the original post. Thanks.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Now that I've read up some on TREND in Excel (have you?), it's clear you need at least two sets of clear data for the comparison. You don't have that in this example, you have 1.

    http://support.microsoft.com/kb/828801

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    D1 and copy to E1: =INDEX(A$1:A$29, MATCH(TRUE, NOT(ISNA($A$1:$A$29)), 0) )

    D2 and copy to E2: =INDEX(A$1:A$29, MATCH(2, 1 / NOT(ISNA($A$1:$A$29)), 1) )

    F2 and copy down: =TREND($D$1:$D$2, $E$1:$E$2, B1)

    However, it's a pretty boring trend, since y-x.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56
    JBeaucaire
    Thanks for the responce. For some reason the columns didn't copy over quite right in the original post. However, as suggested, it appeares correctly in the attatched file, from the original post. I hope that seeing the attatched file will help clarify what I have (column A) and the results I need to attain (column B). I'm not even sure that using the trend command is the correct approach as I'm not that competent with this command. That is indeed why I am looking for help.

    shg
    I tried what I interpreted as your suggestion and failed to make it exicute correctly. Maybe I entered it incorrectly, attatched is what I entered. If you could let me know what I did wrong, that would be awesome. Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Sorry, should have pointed out that the first two are array formulas -- they MUST be confirmed with Ctrl+Shift+Enter instead of just Enter.

  9. #9
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56
    Sorry, I may not be making my problem clear.
    Column A is the data that I have.
    I only have two points of data on it (column A) at any time.
    The data that is in column A isn't alway in the same two cells.
    Column A only retains the last two data entries that fit my criteria.
    New data is added to the top of the list, moving old data down.

    Column B's data doesn't exist.
    Column B shows the results I'm trying to obtain.

    shg
    I did get your suggestion to show the correct data.
    However, the formula references column B which is only an example of the results that I would like to get. So the only thing that I've got to reffernce is that in column A.

    SO another way to say it:
    If I graphed out the two data points that are in column A, it would be a straight line.
    I need column B (which I don't have) to show the data points that the line would fall on.

    Thanks for being patient.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    This has been a roundabout path ...
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    very close to solution, but not there yet.

    shg

    You're right, it has been round about, but getting closer.

    I worked with your suggestion, it's close, but not quite right.
    I was able to reproduce your results when copying exactly.
    In fact, I can change the data (when using the same two cells) in column A and it gives the correct results.
    When I add a row to the top of the list, it still works.

    It doesn't work if I fill in one of the data entries with #N/A and replace the #N/A in another cell with data.

    for example:
    If I change the two data entries (from the attatchment you gave me to try) from A15 and A20 to A1 and A16, then it doesn't calculate correctly.
    This is the type of situation that occurs in this application. A1 being a new data entry meeting my criteria, A15 being moved down to A16 with the addition of new data in A1, and A21(formally A20) simply showing #N/A since only the two newest data entries are shown at any one time.
    Last edited by 173; 12-22-2008 at 09:25 PM. Reason: thought of way to hopefully help clairify

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Oops.

    A3: =MATCH(TRUE, ISNUMBER($A$1:$A$29), 0)

    A4: =MATCH(2, 1 / ISNUMBER($A$1:$A$29), 1)

    Both are still array formulas.

  13. #13
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56
    I must be missing something.
    This works great on the attatched sample, but when I re-write the exact same code to a blank book, the slope and int cells both return the slope cells results.
    What am I over looking?
    You've got it. I don't. Soooo very close

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Post the workbook.

  15. #15
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    workbook

    Here's my attempt at the workbook. The cell in question is D3.
    Attached Files Attached Files
    Last edited by 173; 12-23-2008 at 12:12 PM.

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    The formula in C3:D3 should be a SINGLE array formula entered across the two cells, not the same array formula entered in each separately.

  17. #17
    Registered User
    Join Date
    05-14-2008
    Location
    Southern Illinois
    MS-Off Ver
    2007
    Posts
    56

    Thanks shg

    Thats cool.
    I didn't even have a clue about entering data across two cells.
    A new tool I'll have to research.
    This problem is SOLVED!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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