+ Reply to Thread
Results 1 to 5 of 5

Finding Date and valuation on 2 condtions each

  1. #1
    Registered User
    Join Date
    04-20-2018
    Location
    India
    MS-Off Ver
    MS office 2016
    Posts
    31

    Question Finding Date and valuation on 2 condtions each

    Hello Friends,
    Further in building a portfolio tracking sheet for tracking mutual fund, I need your help in finding following 2 things automatically, I will explain again that in detail here.

    Sheet consist of data entries which are:
    1. Every month there will be some money invested and that I named as "SIP".
    2. And at some point of time I will withdraw that money which I labelled as "Sell".
    Please have a look into the test sheet attached here.

    The data here contains column D as sell or SIP/Sell transactions, Column E is amount invested or withdrawn, column F has Net asset value (NAV) and column G contains Units allotted. Now I want to write 2 formulae to auto calculate the Date as well as updated valuation of investment depending on following cases:

    A. Date calculation cases:
    1. If Column D has one or more "Sell" entries, then the date should be the latest date against the rows which has "Sell" in column D. Here in attached sheet it should be 4/14/2018 (answer).
    Or
    2. If column D doesn't have "Sell" entry, the formula should give the latest Date entered in table.

    B. Now for the Valuation calculation:
    1. If Column D has one or more "Sell" entries, then the Valuation should be sum of all entries of column E against "Sell" in column D. Here in attached sheet it should 37535.8+1256.448=38792.748 (answer).
    Or
    2. If column D doesn't have "Sell" entry, the formula should give the answer = (Sum of Column G entries) * (Latest NAV .i.e last entry in column F).

    I hope I am being clear on the question that I want to ask. Let me know if you need any more information on this.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Finding Date and valuation on 2 condtions each

    Try

    in I2 (Value)


    =IF(COUNTIF($D$4:$D$100,"Sell"),SUMIF($D$4:$D$100,"Sell",$E$4:$E$100),SUM($G$4:$G$100)*LOOKUP(2,1/(F:F<>""),F:F))

    in J2 (date)

    =IF(COUNTIF($D$4:$D$100,"Sell"),MAX(IF($D$4:$D$100="Sell",$C$4:$C$100)),LOOKUP(9999999,$C$4:$C$100))


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    Last edited by JohnTopley; 04-20-2018 at 02:14 PM.

  3. #3
    Registered User
    Join Date
    04-20-2018
    Location
    India
    MS-Off Ver
    MS office 2016
    Posts
    31

    Question Re: Finding Date and valuation on 2 condtions each

    John,
    Thank you very much for your prompt reply. I have tested both the formulae and Date formula (in cell J2) is working perfectly fine.

    Problem with Valuation formula is that if you change the column D entries from "Sell" to "SIP" (from Cell D35 and D38) then the formula should sum all the entries in column E (as shown in cell E2). I have attached the sheet for you reference.

    Appreciate your time and efforts in solving it for me.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Finding Date and valuation on 2 condtions each

    If column D doesn't have "Sell" entry, the formula should give the answer = (Sum of Column G entries) * (Latest NAV .i.e last entry in column F).

    Changed your requirement !!!

    =IF(COUNTIF($D$4:$D$100,"Sell"),SUMIF($D$4:$D$100,"Sell",$E$4:$E$100),SUM($E$4:$E$100))
    Last edited by JohnTopley; 04-21-2018 at 02:15 AM.

  5. #5
    Registered User
    Join Date
    04-20-2018
    Location
    India
    MS-Off Ver
    MS office 2016
    Posts
    31

    Re: Finding Date and valuation on 2 condtions each

    John,

    Sorry for inconvenience caused due to changed requirement. I checked, all formulae works as per requirements. Thanks for you prompt and precise replies.

    I must say this forum is really of a enthusiast and knowledgeable experts like you. Some other forums They take days and days to answer the question.

+ 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. If Condtions & Loop
    By Smarter12 in forum Excel General
    Replies: 11
    Last Post: 06-12-2017, 03:36 PM
  2. [SOLVED] Request help finding text next to a date, finding the same date in another column...
    By Biff Malibu 636 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-11-2016, 12:34 AM
  3. valuation using active date and quantity
    By kooty in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-13-2012, 10:21 PM
  4. Lookup with two condtions
    By dmills27 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-21-2009, 12:02 PM
  5. Average with two condtions
    By Isacael in forum Excel General
    Replies: 4
    Last Post: 03-10-2009, 06:49 AM
  6. [SOLVED] checking two condtions
    By [email protected] in forum Excel General
    Replies: 5
    Last Post: 03-22-2006, 11:25 AM
  7. [SOLVED] SUM IF 2 CONDTIONS
    By ellebelle in forum Excel General
    Replies: 5
    Last Post: 01-04-2006, 03:25 PM

Tags for this Thread

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