Ga naar hoofdinhoud

 Hoe tel je het maximale aantal opeenvolgende positieve / negatieve getallen in Excel?

Als u een lijst met gegevens heeft die zich vermengen met positieve en negatieve getallen, en u nu het maximale aantal opeenvolgende positieve en negatieve getallen wilt tellen zoals in het onderstaande screenshot, hoe kunt u dan met deze taak omgaan in Excel?

Tel het maximale aantal opeenvolgende positieve en negatieve getallen met matrixformules


Tel het maximale aantal opeenvolgende positieve en negatieve getallen met matrixformules

 

 

Pas de volgende matrixformules toe om het maximale aantal opeenvolgende positieve en negatieve getallen te krijgen:

Tel het maximale aantal opeenvolgende positieve getallen:

Voer deze formule in een cel in waar u het resultaat wilt krijgen:

=MAX(FREQUENCY(IF(A2:A20>0,ROW(A2:A20)),IF(A2:A20<=0,ROW(A2:A20))))en druk vervolgens op Ctrl + Shift + Enter sleutels bij elkaar, en u krijgt het juiste resultaat als u nodig hebt, zie screenshot:


Tel het maximale aantal opeenvolgende negatieve getallen:

Voer deze formule in een cel in waar u het resultaat wilt krijgen:

=MAX(FREQUENCY(IF(A2:A20<0,ROW(A2:A20)),IF(A2:A20>=0,ROW(A2:A20))))en druk vervolgens op Ctrl + Shift + Enter toetsen tegelijkertijd, en je krijgt het resultaat zoals je nodig hebt, zie screenshot:

Note: In de bovenstaande formules, A2: A20 is de lijst met celbereik dat u wilt gebruiken.

 

Beste Office-productiviteitstools

🤖 Kutools AI-assistent: Een revolutie teweegbrengen in de data-analyse op basis van: Intelligente uitvoering   |  Genereer code  |  Aangepaste formules maken  |  Analyseer gegevens en genereer grafieken  |  Roep Kutools-functies aan...
Populaire functies: Zoek, markeer of identificeer duplicaten   |  Verwijder lege rijen   |  Combineer kolommen of cellen zonder gegevens te verliezen   |   Ronde zonder formule ...
Super opzoeken: Meerdere criteria VLookup    VLookup met meerdere waarden  |   VOpzoeken over meerdere bladen   |   Fuzzy opzoeken ....
Geavanceerde vervolgkeuzelijst: Maak snel een vervolgkeuzelijst   |  Afhankelijke vervolgkeuzelijst   |  Multi-select vervolgkeuzelijst ....
Kolom Beheerder: Voeg een specifiek aantal kolommen toe  |  Kolommen verplaatsen  |  Schakel de zichtbaarheidsstatus van verborgen kolommen in  |  Vergelijk bereiken en kolommen ...
Uitgelichte functies: Raster focus   |  Ontwerpweergave   |   Grote formulebalk    Werkmap- en bladbeheer   |  resource Library (Auto-tekst)   |  Datumkiezer   |  Combineer werkbladen   |  Cellen coderen/decoderen    Stuur e-mails per lijst   |  Super filter   |   Speciaal filter (filter vet/cursief/doorhalen...) ...
Top 15 gereedschapsets12 Tekst Tools (toe te voegen tekst, Tekens verwijderen, ...)   |   50+ tabel Types (Gantt Chart, ...)   |   40+ Praktisch Formules (Bereken leeftijd op basis van verjaardag, ...)   |   19 Invoeging Tools (QR-code invoegen, Afbeelding invoegen vanaf pad, ...)   |   12 Camper ombouw Tools (Getallen naar woorden, Currency Conversion, ...)   |   7 Samenvoegen en splitsen Tools (Geavanceerd Combineer rijen, Gespleten cellen, ...)   |   ... en meer

Geef uw Excel-vaardigheden een boost met Kutools voor Excel en ervaar efficiëntie als nooit tevoren. Kutools voor Excel biedt meer dan 300 geavanceerde functies om de productiviteit te verhogen en tijd te besparen.  Klik hier om de functie te krijgen die u het meest nodig heeft...

Omschrijving


Office-tabblad Brengt een interface met tabbladen naar Office en maakt uw werk veel gemakkelijker

  • Schakel bewerken en lezen met tabbladen in Word, Excel, PowerPoint in, Publisher, Access, Visio en Project.
  • Open en maak meerdere documenten in nieuwe tabbladen van hetzelfde venster in plaats van in nieuwe vensters.
  • Verhoogt uw productiviteit met 50% en vermindert honderden muisklikken voor u elke dag!

 

Comments (20)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
PPPPPPPQQQQPPPPQQPPQQPPPPPP

I have a data like above. I have applied the formula that you have suggested. It was working fine. Answer was 7.

={MAX(FREQUENCY(IF(A4:AA4=P, COLUMN(A4:AA4)),IF(A4:AA4<>P, COLUMN(A4:AA4))))}
But now my requirement is this formula should consider only the last 10 cells from the formula applied cells. and the answer should come as 6.
Is it Possible.
Please suggest a way
This comment was minimized by the moderator on the site
Hi,
This was very useful. Thank You very much !!
A question, what if in the data array I want to ignore blanks or zeros. Like the if the next number after blank or zero is positive it should add in frequency

Thanks for your help
This comment was minimized by the moderator on the site
Hello, Naveen
To solve your problem, please try the below formula:
=MAX(FREQUENCY(IF(A2:A20>=0,ROW(A2:A20)),IF(A2:A20<0,ROW(A2:A20))))

After copying and pasting the formula, please remember to press Ctrl + Shift + Enter keys together to get the correct result.
Please try, hope it can help you!
This comment was minimized by the moderator on the site
안녕하세요. 감사합니다. 데이터 필터된 상황의 경우에도 연속 손실이나 이익 수를 계산할 수 있는지 궁금합니다. 그리고 데이터 필터된 상횡의 평균 연속손실 수를 계산하는 방법은 있습니까?
Rated 5 out of 5
This comment was minimized by the moderator on the site
Wonderful, thank you! I'm using your formula now, but I have a question: Is there any way to further filter the data so that it only counts consecutive positive/negative cells IF they share a value in a different column? For example, if, using your example above, in Column B (next to your Number List in Column A) the cells were filled with either the letter 'A' or 'B' in random order, what formula would you use to determine the max number of positive cells that are ALSO consecutive A's in Column B?
This comment was minimized by the moderator on the site
It's amazing, just wondering if there a way to highlight consecutives?
This comment was minimized by the moderator on the site
I get an #Value output if there are only a streak of positive numbers only. Also, I get the same error, if there is only negative streak of numbers. It works fine when there are at least 1 positive and at least 1 negative number on the column. Does anybody knows how to fix this issue. I am using open office.Which uses the same commands, except for the " ; " instead of " , " as a separator.
This comment was minimized by the moderator on the site
Hello, Pablo,
The formulas work well in my wotksheet when there are a list of positive or negative numbers, do you press Ctrl + Shift + Enter keys together to get the result?
This comment was minimized by the moderator on the site
Hello,
Tank you for this post.I'm trying to get the average number of consecutive negative number from a row.I've been trying to do it myself but I can't figure it out.
Would you mind helping me ?
Thanks !
This comment was minimized by the moderator on the site
So, usefull context. I was jus making a video for my Youtube Channel. When i googeled some key word, i came across with your formula. First of all, thank you. And secondly i will give reference to this website for the formulas explanation. I have not so many subscriber, but it may give your website a littele bit more traffic. Thank you and have nice day.
This comment was minimized by the moderator on the site
Hi, thank you very much for the information! It's very useful :) I wondering if is posible to add up the Max Number of consecutive negatives? I will apreciate a lot if you can help me. Thank you!!
This comment was minimized by the moderator on the site
Hi, Joan,
To solve your problem, please do with the following array formula:

Sum max number of consecutive positive numbers: (Note: D2 is the cell of the consecutive positive numbers you have counted by the using the formula in this article, please press Ctrl + Shift + Enter keys together)
=MAX((COUNTIF(OFFSET(A2:A18,ROW(A2:A18)-ROW(A2),0,D2),">=0")=D2)*SUBTOTAL(9,OFFSET($A$2:$A$18,ROW(A2:A18)-ROW($A$2),0,D2)))

Sum max number of consecutive negative numbers: (Note: E2 is the cell of the consecutive negative numbers you have counted by the using the formula in this article, please press Ctrl + Shift + Enter keys together)
=MIN((COUNTIF(OFFSET(A2:A18,ROW(A2:A18)-ROW(A2),0,E2),"<0")=E2)*SUBTOTAL(9,OFFSET($A$2:$A$18,ROW(A2:A18)-ROW($A$2),0,E2)))

Please try, hope it can help you!
This comment was minimized by the moderator on the site
how do you count consecutive occurrences of two different values or numbers
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations