+ Reply to Thread
Results 1 to 2 of 2

Return previous value formula

  1. #1
    Registered User
    Join Date
    05-13-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    1

    Return previous value formula

    Hi,

    Ok, I've got part of this solved out, but now it's driving me nuts. I have multiples columns with different prices. I created myself a new column that needs to do this:

    If column H1 already has a value then do nothing. Otherwise look a the previous cell in the adjacent column and return the latest value.

    The catch here is some cells in the previous columns are empty and I need to have the latest value which is not 0. This is because the product is discontinued but I need to have the last price when it got discontinued in my new column.

    This is what I have, my problem is B2:G2, it will return the value it encounters from B2 to G2. I need it to go the other way G2:B2, how the hell do I do this

    =IF(ISBLANK(H1),CELL("content",B1:G1),CELL("content",H1))

    Please tell me there is a solution without having to do a macro!
    Thx
    Regards
    Last edited by NBVC; 05-14-2010 at 07:46 AM. Reason: Marked Solved based on Rep Commentary

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

    Re: Return previous value formula

    =LOOKUP(9.999999e+307,B2:G2) will look up the last numeric entry in that range.

    If you have 0's in there and not blanks...

    then =LOOKUP(2,1/(B2:G2<>0),B2:G2)
    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.

+ 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