+ Reply to Thread
Results 1 to 6 of 6

Identifying turning points in data

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Asia
    MS-Off Ver
    Microsoft 365
    Posts
    238

    Identifying turning points in data

    Hi

    I have a set of data (pls see attached file).

    Could you pls help me to come up with a formula to determine the column numbers of the turning points? For row 1, that would be 5 (i.e. column E) and for row 4 it would be either columns C,D or E.

    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,472

    Re: Identifying turning points in data

    I assume the highlighted cells mark your choices for the turnaround point. Can you explain how you made these choices? Part of programming formulas is to understand the logic you want to use and "translate" that into a sequence of Excel formulas.

    My thought, though it comes to different conclusions is:

    1) Some kind of "slope" or "change" calculation. Perhaps in B8 put =B1-A1 (note relative references) then copy across and down.
    2) Analyze each row for the "smallest" (most negative) change. =MIN(B8:J8) -- maybe in L8
    3) A MATCH() function to locate that smallest change in the row. M8 -- =MATCH(L8,B8:J8,0)

    This algorithm comes to different conclusions for some rows, but it also illustrates the overall algorithm I would use. Change step 1 to whatever calculation makes sense for determining "turn around", then adapt the other steps to make sense of that calculation.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Asia
    MS-Off Ver
    Microsoft 365
    Posts
    238

    Re: Identifying turning points in data

    Dear MrShorty

    Thanks for your reply.

    For row 1, column E was the lowest point before it goes up to 3.5.
    For row 6, column F was the highest point before it goes down to 2.66.

    I put in the formulas you suggested but it doesn't show the cells I highlighted in yellow as the logic is different.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,472

    Re: Identifying turning points in data

    Correct, the logic is different because I am not sure I understand the logic you want to use.

    row 1 and row 6 could be done using a simple MIN()/MAX() logic L1=MATCH(MIIN(A1:J1),A1:J1,0) L6=MATCH(MAX(A6:J6),A6:J6,0), but that simple logic does not work for the other rows.

    Ultimately, the answer to the "how do I return a column number" is usually a MATCH() function of some kind. The difficult part of this is figuring out the logic for the "lookup_value", then figuring out how to work that logic into the spreadsheet.

    To help illustrate my confusion:
    why did you pick column F (2.75) in row 2 instead of column B (3.17)?
    in row 3, why column F instead of column D?
    In row 5, why the minimum at H-I instead of the minimum at E-F and why not the maximum at D?

  5. #5
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Asia
    MS-Off Ver
    Microsoft 365
    Posts
    238

    Re: Identifying turning points in data

    Thanks for your reply.

    why did you pick column F (2.75) in row 2 instead of column B (3.17)? I look back from the latest column "J". Since it is a downtrend, I looked for the most recent peak.

    in row 3, why column F instead of column D? The peak is at column F.

    In row 5, why the minimum at H-I instead of the minimum at E-F and why not the maximum at D? Looking back from column J, the numbers are going up so I looked for the nearest through.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,472

    Re: Identifying turning points in data

    Sorry, I've been away for a bit.

    One common thing I see in your latest -- you appear to be taking the "most recent" (rightmost) peak/trough. Excel's lookup functions prefer to search from left to right rather than from right to left, so the first thing I would probably do is to rearrange the data so that the most recent is on the left and the oldest to the right. Then, a slope or change calculation like I suggested in post #2, followed by something to detect the first time that the change or slope changes from positive to negative (for a peak) or from negative to positive (for a trough) should capture the most recent region where the data turnaround. After creating a copy of the data in inverse order (using an INDEX() function), I calculated a change, then used something like =SIGN(PRODUCT(B17:C17)) to detect where the changes in sign were. Then a MATCH() function [=MATCH(-1,B17:J17,0)] would return the position of the peak trough.

    Row 4 is still a bit of a challenge because the data on that row do not change very often. Because the change on that row is 0 most of the time, That row could probably be detected by searching for the first non-zero change.

    Is that getting closer?

+ 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. Color chart data points/marker points vba error
    By nmckever in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2014, 07:10 AM
  2. Identifying Points in a Scatter Plot
    By jbianco51 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-20-2014, 04:42 PM
  3. [SOLVED] Excel 2010 Identifying data changed in cells and Identifying the changed rows
    By SandyLake in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-13-2013, 01:12 AM
  4. Identifying Current Streaks of Goals/Points
    By alexrawnsley in forum Excel General
    Replies: 9
    Last Post: 10-24-2012, 06:59 PM
  5. Replies: 3
    Last Post: 05-24-2010, 10:51 AM
  6. Replies: 4
    Last Post: 05-30-2008, 10:39 AM
  7. Turning points
    By Faretrade4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2005, 03:49 PM

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