+ Reply to Thread
Results 1 to 12 of 12

formula to "choose" a cell from a range by criteria

  1. #1
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    formula to "choose" a cell from a range by criteria

    Hi all

    I wonder if there's even an elegant way to do the following:

    My spreadsheet is updating live from my broker's server, so I have two columns: column A: Strike prices, column B:option's price
    for instance:
    ____________A_____________B
    1 May18th 18.5 Call__________$0.38
    2 May18th 19 Call____________$0.30
    3 May18th 19.5 Call__________$0.28
    and so on..

    I have an additional cell in which I define a "budget" for the purchase, let's assume it's C3

    My desired formula need to strive to buy the LOWEST strike price (column A) possible, but know that is can't pay more than the value in C3. so all I need is that the formula populate the cell it's written in with the strike price chosen, so in the example above and assuming C3(budget)= 0.35 the formula should return "19" (in the spreadsheet column A is only the strike (185/19/19.5 etc) without the date and option type, so the formula really just need to copy A2 as is).


    My next step is to have a second formula in the neighboring cell to be populated with the price (column B) of the strike chosen earlier, so that in the end I'll have a log of what strike excel "chose" to buy and what he paid for it.



    ANY IDEAS? thanks!

  2. #2
    Forum Contributor
    Join Date
    03-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: formula to "choose" a cell from a range by criteria

    It is not clear to me what it is that you need. You may want to post a workbook with input, desired result and a more concise explanation of what it is that you need.

  3. #3
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Post Re: formula to "choose" a cell from a range by criteria

    thanks Jarko, I attached a demo to demonstrate my needs.. I suppose it's a mix of =max BUT ALSO =IF(X=<Y,...) combination... not that huge on excel so I'm not sure how to do it.. hoping you will have some idea

    johnny
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: formula to "choose" a cell from a range by criteria

    Hi,
    Pls find attached file,
    Attached Files Attached Files

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: formula to "choose" a cell from a range by criteria

    using one cell and option in Cell J1 drop down

    =IF(J1="Call",MIN(IF(($D$2:$D$15<=G3)*($E$2:$E$15="Call"),$B$2:$B$15)),MIN(IF(($D$2:$D$15<=H3)*($E$2:$E$15="Put"),$B$2:$B$15))) -array entered
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  6. #6
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Re: formula to "choose" a cell from a range by criteria

    Brilliant. amazing. I won't even ask how you did it because I've never seen any of these symbols or formulas before so I won't bother you. would it be alright to ask for your help again when we come to adjust your formulas to the actual spreadsheet (the example I gave is a bit simplified, the actual excel is a bit more "complex" than that, but the formulas should remain just the same)

    thank you so much! genius.
    Last edited by ryefield; 05-16-2013 at 04:12 AM.

  7. #7
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Re: formula to "choose" a cell from a range by criteria

    a new challenge on the same line as the issue above - this one is a tad more complicated.. I think all criteria is mentioned in the attached spreadsheet - if anything is unclear I'd be happy to elaborate. I tried working with the solutions provided me here and failed.

    thanks in advance to the genius who solves this
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Re: formula to "choose" a cell from a range by criteria

    at Vlady's request I'm uploading a new spreadsheet with the problem, with some clarifications and expected outcomes to help. Vlady by the way is the mind who solved the last problem. Thanks!
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: formula to "choose" a cell from a range by criteria

    hi,
    See attached file for your issue!
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Re: formula to "choose" a cell from a range by criteria

    Quote Originally Posted by duanzhuanming View Post
    hi,
    See attached file for your issue!
    duanzhuanming - it's working in your spreadsheet, but when I try to copy-paste it to my real spreadsheet (and adjusting the cells selections appropriately) the formulas return either "-1111111111" or weird, false values. see attached spreadsheet - can you spot the problem?

    thanks
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: formula to "choose" a cell from a range by criteria

    You have to confirm all array formulas by pressing Ctrl+shift+Enter!
    see attached file!

    Quote Originally Posted by ryefield View Post
    duanzhuanming - it's working in your spreadsheet, but when I try to copy-paste it to my real spreadsheet (and adjusting the cells selections appropriately) the formulas return either "-1111111111" or weird, false values. see attached spreadsheet - can you spot the problem?

    thanks
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-15-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    70

    Re: formula to "choose" a cell from a range by criteria

    Quote Originally Posted by duanzhuanming View Post
    You have to confirm all array formulas by pressing Ctrl+shift+Enter!
    see attached file!
    oh thanks, I don't have a clue what array formulas are so I'll just nod and pretend I do.. btw, could you please pretend like this is a challenge for you next time, to make all the rest of us here fell a bit better?

    this man is a spreadsheet ninja.

+ 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