+ Reply to Thread
Results 1 to 2 of 2

Need formula to calculate total shares as Buy and sell orders occur. sheet attached

  1. #1
    Registered User
    Join Date
    05-14-2020
    Location
    Texas, United States
    MS-Off Ver
    365 proplus
    Posts
    1

    Lightbulb Need formula to calculate total shares as Buy and sell orders occur. sheet attached

    Trying to create a trading journal for my stock portfolio but cannot find anyway to make it work. Column H is my problem. What i hope to accomplish is as buy and sell orders occur the formula will return accurate previous units. thank you in advance for anyone that can assist with creating this formula.

    The formula here does what i need in google sheet but have spent days attempting to translate it to excel with no luck. Hoping someone familiar will see easy solution that I'm missing.

    Formula in cell H2(works in sheets but not excel) =IFERROR(IF(ROW()<>2,INDEX(FILTER($I2:$I$2,$C2:$C$2<>"",ROW($C2:$C$2)=MAX(IF($C2:$C$2=C3,ROW($C2:$C$2),0))),1),0),0)

    God bless,
    Jeff
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Need formula to calculate total shares as Buy and sell orders occur. sheet attached

    I am surprised your formula above works in GoogleSheets (in H2) as it would generate a circular reference. Regardless, the below should work for you in XL:

    H2: =IFERROR(LOOKUP(2,1/($C$1:$C1=$C2),$I$1:$I1),0)

    the same can be used in GoogleSheets but would require ArrayFormula prefix (seems to evaluate a little differently there when compared to XL)

+ 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] Formula to calculate $ Total from another Sheet, if two criteria are met.
    By EWolfe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2019, 05:16 PM
  2. [SOLVED] Formula to calculate $ Total from another Sheet, if criteria is met.
    By EWolfe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2019, 05:01 PM
  3. Attached Photo and create line orders in excel
    By alive555 in forum Excel General
    Replies: 1
    Last Post: 06-03-2018, 07:25 AM
  4. Replies: 1
    Last Post: 05-10-2017, 12:11 PM
  5. A Formula that can calculate bulk orders
    By tommywat in forum Excel General
    Replies: 22
    Last Post: 07-18-2012, 10:40 AM
  6. [SOLVED] I need to calculate a fixed percentage of closed to total orders
    By wurugu in forum Excel General
    Replies: 8
    Last Post: 06-30-2012, 07:23 PM
  7. Create Running Log when Financial Model triggers Buy / Sell Orders
    By TDWalt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2008, 01:46 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