+ Reply to Thread
Results 1 to 8 of 8

Index and match function for Last Month figures

  1. #1
    Registered User
    Join Date
    12-22-2010
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    74

    Index and match function for Last Month figures

    Hi,

    I tried to use index and match function to look for last month as shown attached (column M). But it works fine when there are two months, but when it comes to more than two months, the function failes.

    Can someone here please advise how to rectify this issue?

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Index and match function for Last Month figures

    If you want the figure before the last 'actual':
    =INDEX($A4:$K4,MATCH("actual",$B$1:$L$1,1))
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    12-22-2010
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    74

    Re: Index and match function for Last Month figures

    Hi Cheeky Charlie,

    Thanks for your reply.

    Based on your formula, it means i need to change the linking every month in order to capture the figure before the last 'actual'. I prefer to have it automation. Any suggestion?

    Thanks again

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Index and match function for Last Month figures

    Try this:

    =INDEX($A4:$L4,1,COUNTIF(A1:L1,"Actual"))

  5. #5
    Registered User
    Join Date
    12-22-2010
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    74

    Re: Index and match function for Last Month figures

    Hi Cutter,

    I tried but it gives me March figure instead of Feb.

    Thanks

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Index and match function for Last Month figures

    I thought that was what you wanted.

    Just subtract 1 from the COUNTIF() to get the second last actual.

    =INDEX($A4:$L4,1,COUNTIF(A1:L1,"Actual")-1)

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Index and match function for Last Month figures

    To avoid error when looking for January you can use:

    =INDEX($A4:$L4,1,MAX(1,COUNTIF($A$1:$L$1,"Actual")-1))

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Index and match function for Last Month figures

    change the linking every month in order to capture the figure before the last 'actual'.
    I don't understand. With the given formula each time you add 'actual' in row 1 you get the next value.

    Automatic by date would look like:
    =INDEX(A4:L4,MONTH(TODAY())-1)

    Be specific about what you want.

+ 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