# Microsoft Office Application Help - Excel Help forum > For Other Platforms(Mac, Google Docs, Mobile OS etc) >  >  Google Sheets: Calculate longest winning streak

## yonifx

Hi everyone,

I'm trying to calculate the winning streaks of my trades,
any idea on how to do it?

667788.JPG

thanks,
Yoni

----------


## AliGW

Welcome to the forum!

Did you search the forums before posting? I did a search for you: https://www.excelforum.com/search.php?searchid=7648859

----------


## yonifx

Hi AliGW,

Thanks for your quick reply, i didn't find what i was looking for and the link that you added doesn't go anywhere.
what should i do?

----------


## AliGW

Type "winning streak" (without the speech marks) into the search box top right.

----------


## Glenn Kennedy

Try something like this array formula:

=MAX(FREQUENCY(IF($A$2:$A$33="Win",ROW($A$2:$A$33)), IF($A$2:$A$33<>"Win",ROW($A$2:$A$33))))

Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the *FIRST CELL ONLY* by pressing *CTRL+SHIFT+ENTER* to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again. 

Don't type the curly brackets yourself - it won't work...

----------


## yonifx

Hi Glenn,

Thank you very much!

It works on excel perfectly but when i try it on google sheets it didn't work, do you know how to do it in google sheets also?
And, can i add to the formula to calculate it per currency?

----------


## Glenn Kennedy

Please post a sample sheet.  I don't want to retype what you have in front of you.  I don't use Google sheets.

Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)?  Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).



Unfortunately the attachment icon doesn't work at the moment.  So, to attach an Excel file you have to do the following:  Just before posting, scroll down to *Go Advanced*  and then scroll down to *Manage Attachments*.  Now follow the instructions at the top of that screen.

----------


## yonifx

ok
please see attached file

----------


## AliGW

If you are using another platform to Excel, you need to say so from the start. I've moved your thread to the correct section.

----------


## yonifx

I"m using both excel & google sheets.
I need this formula to a number of calculations.

----------


## Glenn Kennedy

here you are.

----------


## yonifx

Thank you very very much!!
 :Smilie:

----------


## AliGW

If that takes care of your original question, please select _Thread Tools_ from the menu link above and mark this thread as SOLVED. Thanks.

----------


## Glenn Kennedy

You're welcome.


If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as *SOLVED*. 

It'd also be appreciated if you were to click the *Add Reputation* button at the foot of any of the posts of all members who helped you reach a solution.

----------


## AliGW

Now marked as unsolved as the OP has a follow-on question.

----------


## yonifx

I'm trying to create a winning streak formula like in my excel but when i press CTRL+SHIFT+ENTER it doesn't work like in excel, it only adds ARRAYFORMULA before my formula and gives me ERROR..

Any ideas what to do?

I really don't have to use ARRAYFORMULA, just want to find the formula that calculates the longest winning streak.

Streaks.JPG

----------


## yonifx

does anyone know how to do it in google sheets?

----------


## AliGW

Please be patient.  :Smilie:

----------

