+ Reply to Thread
Results 1 to 22 of 22

Additional criteria for existing formula

  1. #1
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Additional criteria for existing formula

    Hi all,

    I'm struggling with adding an additional criteria into a existing formula...

    I have already figured out how I can count consecutive WIN/LOSS. (Formula in cell F17)

    However, I must add one more criteria.

    The formula in cell H17 should count consecutive WIN/LOSS of "S" from column L.

    Please note: I'm using a german version so the formula contains ';' instead of ','

    Thanks for any help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Additional criteria for existing formula

    I think that you are over complicating this.

    This Formula will count occurrences of S followed by S (SS) =5
    =LEN(TEXTJOIN(,TRUE,Tab_RawData[L / S]))-LEN(SUBSTITUTE(TEXTJOIN(,TRUE,Tab_RawData[L / S]),"SS","S"))

    What would happen if there are three S's in sequence. Does that count as One repetition or two?

    I have Checked and the formula does not recognise (SSS) or (SSSS) but I don't know how you want then counted.

    If you want "SSS" counted as 2 then use SUBSTITUTE(TEXTJOIN(,TRUE,Tab_RawData[L / S]),"SSS","SS:SS") inside the Formulas above.

    If you want "SSSS" counted as 3 then use SUBSTITUTE(TEXTJOIN(,TRUE,Tab_RawData[L / S]),"SSSS","SS:SS:SS") inside the Formulas above.
    Last edited by mehmetcik; 02-29-2020 at 03:03 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    I probably didn't explain it clearly.

    Just for better explaination:

    S from column L stands for Short
    L stands for Long

    The formula:


    Please Login or Register  to view this content.
    ...counts all the consecutive "WIN" from column P. So far so good...

    Now, I additionally need a counter of the consecutive WINS just for the Shorts. (if S in column L).

    So it should only count the consecutive WINS when in column L is a 'S'.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Additional criteria for existing formula

    Formula Entered using Ctrl Shift Enter.

    =(LEN(TEXTJOIN("",TRUE,Tabelle2[L / S]&Tabelle2[Win / LOSS]))-LEN(SUBSTITUTE(TEXTJOIN("",TRUE,Tabelle2[L / S]&Tabelle2[Win / LOSS]),"LWINLWIN","LWIN")))/4

  5. #5
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    Mehmet thank you for your fast reply.

    Unfortunately it doesn't show the right result.

    It shows 5 instead of 4.

    When I filter my table to show only 'S' then it has Max. 4 consecutive WINS. (Trade # 18, 20, 22 and 23)
    Attached Images Attached Images

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Additional criteria for existing formula

    Winding this back a bit. My Formula was wrong. I Got distracted. It was looking for the wrong Match.

    This formula Ctrl Shift Enter Returns 10.

    So there are 10 Short Wins. Not 4 as you say. 53 and 55 are also matches for example.

    =SUM(IF(Tabelle2[L / S]&Tabelle2[Win / LOSS]="SWIN",1,0))

    However is only one sequential Short Win. 22 and 23.

    This Formula Entered using Ctrl Shift Enter Returns 1.

    =(LEN(TEXTJOIN("",TRUE,Tabelle2[L / S]&Tabelle2[Win / LOSS]))-LEN(SUBSTITUTE(TEXTJOIN("",TRUE,Tabelle2[L / S]&Tabelle2[Win / LOSS]),"SWINSWIN","SWIN")))/4
    Last edited by mehmetcik; 02-29-2020 at 05:31 PM.

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Additional criteria for existing formula

    how about below array entered
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  8. #8
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    It should not calculate the summary of all WINS for Short.

    It should calculate the maximum consecutive WINS in a row for Short.

    As you can see in the picture before, Trade# 18, 20, 22 and 23 was a WIN. (4 WIN trades in a row) Trade # 25 was LOSS, so the counter goes back to 0.

    Another example:

    1) LOSS
    2) WIN
    3) WIN
    4) WIN
    5) WIN
    6) WIN
    7) WIN
    8) WIN
    9) LOSS

    For that example it would be: 7 consecutive WINS.

    This 7 consecutive WINS would be the maximum consecutive WINS until it exceed more then 7 WINS in a row.

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Additional criteria for existing formula

    18, 20, 22 are not Sequential.

  10. #10
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    That's true in terms of Trade# but if you look just for "Short" they are sequential.

  11. #11
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    I was trying this formula

    Please Login or Register  to view this content.
    But it display "False"

  12. #12
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Additional criteria for existing formula

    Hello rtprcnb,
    Have you tried formula from POST#7

  13. #13
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    Hi Hemesh,

    Yes but it shows an error.
    Attached Images Attached Images

  14. #14
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Additional criteria for existing formula

    check the attachment its working fine here !
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    I have added more data in the table below as a test. Now the formula should show the number 6, but it still shows 4.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Additional criteria for existing formula

    the formula provided is looking for sequential on the basis of month that in which particular month maximum "S" with "Win" are present

  17. #17
    Forum Contributor
    Join Date
    09-18-2015
    Location
    Republic of Korea
    MS-Off Ver
    2010
    Posts
    314

    Re: Additional criteria for existing formula

    Hi! rtprcnb

    =MAX(FREQUENCY(IF((Tabelle2[L / S]="S")*(Tabelle2[Win / LOSS]="WIN"),ROW(Tabelle2[Win / LOSS])),IF((Tabelle2[L / S]="L")+(Tabelle2[Win / LOSS]="LOSE"),ROW(Tabelle2[Win / LOSS]))))

  18. #18
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    Hi Chief_abound!

    Your formula nearly works...

    I have inserted the file.
    The green fields are correct, the red fields are not right. Probably some small twist in the formula is needed.

    In cell H17 should be 4 instead of 2
    In cell G18 should be 6 instead of 5

    (Cell G17 and H18 are correct)

    I have already tried different variations but nothing works.
    Attached Files Attached Files

  19. #19
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,993

    Re: Additional criteria for existing formula

    E
    F
    G
    H
    5
    All
    L
    S
    6
    Net Profit
    $3,228.42
    $1,070.94
    $2,157.48
    7
    Trades Total
    57
    39
    18
    8
    Number Winning Trades
    30
    20
    10
    9
    Number Losing Trades
    27
    19
    8
    10
    Avg Trade (win/loss)
    $56.64
    $27.46
    $119.86
    11
    Avg Winning Trade
    $107.61
    $53.55
    $215.75
    12
    Avg Losing Trade
    $119.57
    $56.37
    $269.69
    13
    Percent Profitable
    52.63%
    51.28%
    55.56%
    14
    Avg Monthly Return (PIVOT?)
    ?
    ?
    ?
    15
    Largest Winning Trade
    2351.46
    1692.06
    2351.46
    16
    Largest Losing Trade
    -1126.14
    -1126.14
    -743.94
    17
    WIN
    5
    4
    4
    18
    LOSS
    7
    6
    2



    G17=MAX(FREQUENCY(IF($P$6:$P$62=$E17,IF($L$6:$L$62=G$5,ROW($P$6:$P$62))),IF($P$6:$P$62<>$E17,IF($L$6:$L$62=G$5,ROW($P$6:$P$62)))))

    Control+shift+enetr

    Copy across and down

  20. #20
    Registered User
    Join Date
    02-23-2020
    Location
    Zurich, Switzerland
    MS-Off Ver
    365
    Posts
    11

    Re: Additional criteria for existing formula

    Ciao CARACALLA,

    It's working

    Grazie mille!! Thank you very much!

  21. #21
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Additional criteria for existing formula

    Thanks for the feedback !

  22. #22
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,993

    Re: Additional criteria for existing formula

    Ciao

    You are welcome

+ 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. Replies: 2
    Last Post: 03-10-2020, 04:06 PM
  2. to extract additional one field on existing formula
    By michael35 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2020, 02:50 PM
  3. [SOLVED] Modfication of Existing Code for additional additional cells
    By thilag in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2016, 03:00 AM
  4. [SOLVED] Formula to Add Additional Characters to an existing cell
    By Tamarissa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2015, 07:00 PM
  5. Additional condition to existing formula
    By pauldaddyadams in forum Excel General
    Replies: 2
    Last Post: 04-09-2015, 08:44 AM
  6. [SOLVED] need to add additional criteria to existing formula
    By Mattr177 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2014, 12:12 AM
  7. [SOLVED] Adding additional selection criteria to existing Macro
    By Mogpot1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2013, 10:29 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