+ Reply to Thread
Results 1 to 5 of 5

Formula to compare last 2 numbers in row for upward, downward trend calculation

  1. #1
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile Formula to compare last 2 numbers in row for upward, downward trend calculation

    Hi All,

    This is a follow up to a recent post of mine regarding KPI figures (link below) which was answered by cbatrody (kudos to cbatrody many thanks).

    http://www.excelforum.com/showthread...t=#post4139336

    In the thread above I asked for a formula that would look at only the last value of a row that matched the month of today's date. I would like to know what formula I could use to compare the last two numbers in a column so that I can track upwards, downwards or sideways trend.

    I have attached a sample to illustrate the desired outcome. It needs to be dynamic and look at the dates in row 2 (formatted in 'mmm' format) and compare the latest month to the previous month. So for example in the attached as it is July 24 today and not the end of July; it should compare the May and June figures.

    Take row 6 as an example; in column R I am using the SIGN formula:
    Please Login or Register  to view this content.
    This compares June (column G6) and subtracts the figure from May (column F6). The result produces 1 for updward trend, -1 for downward trend and 0 for sideways or no movement trend. Then I use the Arros Icon set to map the direction. And an aditional conditional formatting Red Amber Green to track we the figures are in relation to the annual targets. So you may have an amber target but an upward trend.

    Is there a way to adapt the formula in the link to my previous post so that it can compare the last two figures?
    Attached Files Attached Files
    Best Regards.

    Michael
    -----------------------------------
    Windows Vista, Microsoft Office 2007

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Formula to compare last 2 numbers in row for upward, downward trend calculation

    Try this in R4:

    =SIGN(INDEX(E4:P4,COUNT(E4:P4))-INDEX(E4:P4,COUNT(E4:P4)-1))

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Re: Formula to compare last 2 numbers in row for upward, downward trend calculation

    Hi Pete,

    Sorry for the late response, I've very busy at work today. Thanks for your response and the excellent formula it works great! The only issue I may have is that the spreadsheet for the 'live' KPI spreadsheet is linked and shows zeros this may affect this formula. Sorry I should have mentioned that.

    I got around this by using this formula, I hope this works ok it seems to.
    Please Login or Register  to view this content.
    Many thanks again for your help Pete I have added to your Rep and marked the thread as solved.

  4. #4
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Re: Formula to compare last 2 numbers in row for upward, downward trend calculation

    Sorry my post above is incorrect. What I meant to say is that in the cells in columns E:P which are linked. I used the formula below so that blanks appear instead of zeros.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,824

    Re: Formula to compare last 2 numbers in row for upward, downward trend calculation

    Yeah, that makes more sense now.

    Glad you got it working - thanks for the rep.

    Pete

+ 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. [SOLVED] How to create a line chart to compare trend of two activities
    By LWLS in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-27-2014, 09:59 AM
  2. Trend formula- consecutive positive and negative numbers
    By Col83 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-05-2014, 02:53 AM
  3. [SOLVED] Trend Calculation using VBA
    By a_driga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2014, 09:54 PM
  4. [SOLVED] Calculation // trend Analysis
    By nicci113 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2013, 05:19 PM
  5. Excel 2007 : How can I auto fill numbers going upward
    By budchevy in forum Excel General
    Replies: 6
    Last Post: 06-14-2011, 08:11 AM
  6. Need help with trend calculation
    By excelify in forum Excel General
    Replies: 2
    Last Post: 04-15-2010, 08:44 AM
  7. Program for calculation a power trend line.
    By Houston banker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2005, 05:05 PM

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