+ Reply to Thread
Results 1 to 3 of 3

Previous Occurences DISCUSSION

  1. #1
    Registered User
    Join Date
    08-19-2013
    Location
    Solo
    MS-Off Ver
    Excel 2010, 2013
    Posts
    2

    Lightbulb Previous Occurences DISCUSSION

    Hey everyone,

    I'd love to hear some opinions regarding VALUE OF PREVIOUS OCCURENCES.
    Let's take a FRUIT SHOP as an example.

    A B C D E F
    1 Date Fruit Buy Sell Previous Stock Current Stock
    2 8/1/13 Apple 50 0 0 50
    3 8/1/13 Banana 50 0 0 50
    4 8/1/13 Orange 50 0 0 50
    5 8/2/13 Apple 0 10 50 40
    6 8/3/13 Apple 0 5 40 35
    7 8/4/13 Banana 0 10 50 40

    We also assume that,
    1. Every DATE and FRUIT pair is UNIQUE
    2. List are sorted in ASCENDING order

    What I'm trying to achieve here is to retrieve value of PREVIOUS STOCK of CURRENT ROW's FRUIT which is CURRENT STOCK of PREVIOUS OCCURENCE of CURRENT ROW's FRUIT.
    The formula I'm currently using is,

    E5 =LOOKUP(2,1/(B$2:B4=B5),F$2:F4)

    Some questions I'd like to ask,
    1. Is it possible to replace B$2:B4 and F$2:F4 with a NAMED RANGE?
    2. Is there another formula which can perform better when we have thousands of row data?
    3. How can we improve the formula so it can be used in cell E2, E3, and E4?

    Thank you for reading! I'm looking forward to hear some feedbacks.

    Regards,


    Mustank
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Previous Occurences DISCUSSION

    In Row 2

    Previous stock
    =SUMIF($B$1:B1,B2,$C$1:C1)-SUMIF($B$1:B1,B2,$D$1:D1)

    Current stock
    =SUMIF($B$1:B2,B2,$C$1:C2)-SUMIF($B$1:B2,B2,$D$1:D2)

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    08-19-2013
    Location
    Solo
    MS-Off Ver
    Excel 2010, 2013
    Posts
    2

    Re: Previous Occurences DISCUSSION

    @Ace_XL

    Wow! I never thought it can be solved that way. Thank you! Is there any chance to substitute range in your formula with NAMED RANGE?

    Can you give me an example where formula =LOOKUP(2,1/(B$2:B4=B5),F$2:F4) can be used best?

    And don't you think formula =C2-D2+E2 is better for CURRENT STOCK?

+ 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. MS Office Discussion Groups
    By shumba in forum Excel General
    Replies: 3
    Last Post: 06-11-2010, 08:28 PM
  2. Data Recovery Discussion
    By rajnish1579 in forum Excel General
    Replies: 2
    Last Post: 03-11-2010, 08:41 AM
  3. [SOLVED] off the discussion group asap
    By accountant2005 in forum Excel General
    Replies: 3
    Last Post: 02-26-2005, 09:06 AM

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