+ Reply to Thread
Results 1 to 5 of 5

Finding the Min Positive Value of Dynamic Data

  1. #1
    Registered User
    Join Date
    10-30-2009
    Location
    Chevy Van, NearRiver
    MS-Off Ver
    Excel 2007
    Posts
    3

    Finding the Min Positive Value of Dynamic Data

    I searched the forum but couldn't find what I was looking for. I've found lots of solutions for finding the min positive value of an array, but let me elaborate on my problem.

    One cell in my sheet is returning values from a DDE link from a third-party trading platform. The cell continuously updates Net Profit/Loss. I want two different cells to record the max value and min value that had appeared throughout the day. Assume Net P/L cell was A1, and the Max cell was B1, Min cell was B2.

    So I've tried the obvious attempt in B1, =max(a1,b1) which will only work if my Net P/L is positive. But if my P/L is negative it will remain zero, since that was the default value of B1 before calculations begin. Likewise, my min in B2 will remain zero, unless my Net P/L is negative. So on days where I am only making positive cumulative profits on my trading positions, I have no record of what my lowest level of profit was throughout the day.

    I have tried other circular references such as seeking the max value in cell b1: =if(b1>a1, b1, a1) but this of course returns the same problematic result.

    I've googled this, and probably should have just asked for help sooner.

    Thanks.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Finding the Min Positive Value of Dynamic Data

    Can't you set your template up such that B1 initially contains a value less than any number you would be expecting? It will be replaced therefore on the first upload of data. And in B2, a value greater than any value you would be expecting?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-30-2009
    Location
    Chevy Van, NearRiver
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Finding the Min Positive Value of Dynamic Data

    how do I assign a value to the cell without it replacing the formula?

    I think its my fault for the way I posed the question orignally when I said "So I've tried the obvious attempt in B1, =max(a1,b1) which will only work if my Net P/L is positive. But if my P/L is negative it will remain zero, since that was the default value of B1 before calculations begin." Maybe that was not the most precise way of describing it. Cell A1 has the streaming data coming in from DDE link, B1 contains =if(b1>a1,b1,a1) and that is all B1 contains, so I guess the formula recognizes no pre-assigned value for B1 other than its circular reference formula, and so it always returns 0 by default, when A1 is less than 0. But on days when I start losing money right off the bat, it would be helpful to know at what point I was losing the least amount of money.
    Last edited by GriefEriksson; 10-30-2009 at 01:27 PM. Reason: clarification

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Finding the Min Positive Value of Dynamic Data

    Does B1 = 0 or "" initially? Can you change your formula to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-30-2009
    Location
    Chevy Van, NearRiver
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Finding the Min Positive Value of Dynamic Data

    That solves the problem as I described it. I now have a whole host of other problems, but I think they belong in new thread. /me ups your rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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