+ Reply to Thread
Results 1 to 9 of 9

Check value in a time range

  1. #1
    Registered User
    Join Date
    02-21-2008
    Posts
    6

    Check value in a time range

    Hi,

    I have a table with dates and respective stock prices.
    Now i'm trying to check if - during a certain time period - the stock price has been below a certain value. Since I will have to do the same thing for more than 1000 values in different time periods, I can't do it manually. Any idea how to do this in a spreasheet without vba? If not, then by vba?

    Sheet looks as following:

    A1 Starting date of period
    B1 Ending date of period
    C1 Barrier value (Value that needs to be checked)
    A2 - A366 Dates (2007)
    B2 - B366 Stock prices (2007)

  2. #2
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Can you attach a sample file and the expected results?
    Corine

  3. #3
    Registered User
    Join Date
    02-21-2008
    Posts
    6
    Obviously...help appreciated.
    Attached Files Attached Files
    Last edited by badin; 02-22-2008 at 09:05 AM.

  4. #4
    Registered User
    Join Date
    02-21-2008
    Posts
    6

    Check if-function in a time range

    Hi,

    I have posted the same question under the worksheet function thread

    http://www.excelforum.com/showthread...98#post1885298

    but it's probably more of a programming problem.

    I have a table with dates and respective stock prices.
    Now i'm trying to check if - during a given time period - the stock price has been below a certain value. Since I will have to do the same thing for more than 1000 values in different time periods, I can't do it manually. Any idea how to do this in a spreasheet without vba? If not, then by vba?

    Help would be very much appreciated...
    Attached Files Attached Files

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =IF(SUMPRODUCT(($A$9:$A$89>=B$2)*($A$9:$A$89<=B$3)*(INT(B$9:B$89)=B$4))>0,"Yes","No")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    02-21-2008
    Posts
    6

    Thumbs up

    Great, thx a lot.
    Had to adjust it a little bit to

    =IF(SUMPRODUCT(($A$9:$A$89>=D$2)*($A$9:$A$89<=D$3) *(D$9:D$89<=D$4))>0;"Yes";"No")

    but it was of great help.

    badin

  7. #7
    Registered User
    Join Date
    02-21-2008
    Posts
    6
    Follow-up question...

    in the excel sheet i have the stocks are not in same coloumns as the values that i would like to check. Even worse, the values that i need to check are not in the same sheet as the stocks. Example attached.

    any idea on this?
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-14-2007
    MS-Off Ver
    Excel 2021
    Posts
    121
    I'm interested in what you're trying to do with your stock data. This attached file should help you organize how you set up your spreadsheet.

    How detailed are you getting with your spreadsheet?

    Thanks,
    Impala
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-21-2008
    Posts
    6
    Thanks...
    but it doesn't really work, 'cause i still need to link every barrier with the correct stock manually.

    I'm using it for a paper that i'm writing on barrier options (financial derivatives). need to check if certain barriers have been knocked or not.

+ 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