Been a long going excel user, which means I rarely come across something I can't immediately figure out. That being said, I can't think of an easy way to solve this =IF statement; hopefully this is super easy and I'm just being silly :p
I'm trying to determine the % gain and % loss from a string of consecutive negatives or positives, and more specifically the largest string for both negatives and positives. For example, if I have a list: 22%, 12%, 13%, (-)18%, 2%, 4%, (-)2%, (-)5%, (-)10%, 12%, 1%, etc. etc., I want to find the strings of positives (22,12,13 and 2,4) and multiply them one by one to determine a %gain to initial after those three and two transactions; the same goes for the negative strings (-2,-5,-10). Because 22,12,13 is a string of three versus 2,4 a string of two, I want to only find the gain for the string 22,12,13.
Here's what I've got for counting the longest string so far:
=ArrayFormula(MAX(FREQUENCY(IF(B10:B98<0%,ROW(B10:B98)),IF(B10:B98>=0%,ROW(B10:B98))))) [changing the inequalities for + and - values]
Because I can't just sum the string (sum of % isn't compounded gain or loss), I can't think of an easy way to find the longest string (which may or may not be the largest or smallest value).
Any input is greatly appreciated![]()
Bookmarks