+ Reply to Thread
Results 1 to 7 of 7

values of adjacent cells

  1. #1
    Registered User
    Join Date
    06-09-2011
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    values of adjacent cells

    Hi all,
    This is my first post.

    I have created a Pivot that is refreshed every month, adding a non-blank column at the end of the Pivot Table.
    On a separate worksheet, I want every month to see the value of the cell of last non-blank column of the Pivot and of the cells in the 12 columns before the last one (i.e. the last 13 non-blank columns). So every month, this changes as there is a new "last non-blank cell".

    I found how to return the value of the last non-blank cell.
    What I am struggling with is to have the values of each of the 12 other cells...
    I suspect this should be accomodated with INDEX and MATCH but I can't find out.

    Any hint? Any help?

    Thanks!
    Last edited by NBVC; 06-09-2011 at 05:06 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: values of adjacent cells

    You mean you are trying to bring back an item from another column that coincides with the last entry in a separate column?

    If yes,

    If you are looking for a last numeric entry, in say column F and want to bring back column D items, try:

    =LOOKUP(9.99999E+307,F:F,D:D)

    if it is text entries in column F, then

    =LOOKUP(REPT("z",255),F:F,D:D)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-09-2011
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: values of adjacent cells

    Thank you NBVC,
    Your understanding is correct. However, it is trickier than this...
    The LOOKUP function you are proposing is the one I use to find the last non-blank cell. But it is not necessarily in column "F" (as per your example).
    Say it is in column "F" this month. Then next month it will be in column "G" and then "H" and so on.
    So I need a formula that automatically finds the last non-blank cell and that gives me its value.

    For example say that in June the last non-blank cell is Z1, I want in the cell M2 the value of Z1. But in July, I will want in M2 the value of AA! (as the Pivot will generate a value in AA1). So the LOOKUP function will easily give me the Z1 (or AA1) value.
    What I then need in L2 is the value of Y1 (in June) and Z1 (in July).

    Do you know how to change the LOOKUP formula for L2?

    Thanks again!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: values of adjacent cells

    Can you show a picture of the pivot table..

    or better post a sample workbook showing what you mean? Finding it hard to visualize....

  5. #5
    Registered User
    Join Date
    06-09-2011
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: values of adjacent cells

    Hi,
    I've attached a picture of what I need.
    This is not an actual Pivot but I think you will get it!
    Thanks again!
    Attached Images Attached Images

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: values of adjacent cells

    How about in F7

    =INDEX(B2:H2,Match(9.9999999e+307,B2:H2))

    in E7:

    =INDEX(B2:H2,Match(9.9999999e+307,B2:H2)-1)

    in D7:


    =INDEX(B2:H2,Match(9.9999999e+307,B2:H2)-2)

  7. #7
    Registered User
    Join Date
    06-09-2011
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: values of adjacent cells

    You're great! Thanks!

+ 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