Salt la conținutul principal

 Cum se numără numărul maxim de numere consecutive pozitive / negative în Excel?

Dacă aveți o listă de date care se amestecă cu numere pozitive și negative și acum doriți să numărați numărul maxim de numere consecutive pozitive și negative după cum se arată în următoarea captură de ecran, cum ați putea face față acestei sarcini în Excel?

Numărați numărul maxim de numere consecutive pozitive și negative cu formule matrice


Numărați numărul maxim de numere consecutive pozitive și negative cu formule matrice

 

 

Pentru a obține numărul maxim de numere consecutive pozitive și negative, vă rugăm să aplicați următoarele formule matrice:

Numărați numărul maxim de numere consecutive pozitive:

Introduceți această formulă într-o celulă unde doriți să obțineți rezultatul:

=MAX(FREQUENCY(IF(A2:A20>0,ROW(A2:A20)),IF(A2:A20<=0,ROW(A2:A20)))), apoi apăsați Ctrl + Shift + Enter tastele împreună și veți obține rezultatul corect după cum aveți nevoie, consultați captura de ecran:


Numărați numărul maxim de numere negative consecutive:

Introduceți această formulă într-o celulă unde doriți să obțineți rezultatul:

=MAX(FREQUENCY(IF(A2:A20<0,ROW(A2:A20)),IF(A2:A20>=0,ROW(A2:A20)))), apoi apăsați Ctrl + Shift + Enter simultan și veți obține rezultatul după cum aveți nevoie, vedeți captura de ecran:

notițe: În formulele de mai sus, A2: A20 este lista intervalului de celule pe care doriți să îl utilizați.

 

Cele mai bune instrumente de productivitate de birou

🤖 Kutools AI Aide: Revoluționați analiza datelor pe baza: Execuție inteligentă   |  Generați codul  |  Creați formule personalizate  |  Analizați datele și generați diagrame  |  Invocați funcțiile Kutools...
Caracteristici populare: Găsiți, evidențiați sau identificați duplicatele   |  Ștergeți rândurile goale   |  Combinați coloane sau celule fără a pierde date   |   Rundă fără Formula ...
Super căutare: VLookup cu mai multe criterii    VLookup cu valori multiple  |   VLookup pe mai multe foi   |   Căutare fuzzy ....
Listă derulantă avansată: Creați rapid o listă derulantă   |  Listă drop-down dependentă   |  Listă derulantă cu selectare multiplă ....
Manager de coloane: Adăugați un număr specific de coloane  |  Mutați coloanele  |  Comutați starea vizibilității coloanelor ascunse  |  Comparați intervale și coloane ...
Caracteristici prezentate: Focus pe grilă   |  Vedere de proiectare   |   Big Formula Bar    Manager registru de lucru și foi   |  Biblioteca de resurse (Text automat)   |  Data Picker   |  Combinați foi de lucru   |  Criptare/Decriptare celule    Trimiteți e-mailuri după listă   |  Super Filtru   |   Filtru special (filtrează bold/italic/barat...) ...
Top 15 seturi de instrumente12 Text Instrumente (Adăuga text, Eliminați caractere,...)   |   50+ Diagramă Tipuri de (Gantt Chart,...)   |   40+ Practic Formule (Calculați vârsta pe baza zilei de naștere,...)   |   19 inserare Instrumente (Introduceți codul QR, Inserați imaginea din cale,...)   |   12 Convertire Instrumente (Numere la cuvinte, conversie valutara,...)   |   7 Merge & Split Instrumente (Rânduri combinate avansate, Celule divizate,...)   |   ... și altele

Îmbunătățiți-vă abilitățile Excel cu Kutools pentru Excel și experimentați eficiența ca niciodată. Kutools pentru Excel oferă peste 300 de funcții avansate pentru a crește productivitatea și a economisi timp.  Faceți clic aici pentru a obține funcția de care aveți cea mai mare nevoie...

Descriere


Fila Office aduce interfața cu file în Office și vă face munca mult mai ușoară

  • Activați editarea și citirea cu file în Word, Excel, PowerPoint, Publisher, Access, Visio și Project.
  • Deschideți și creați mai multe documente în filele noi ale aceleiași ferestre, mai degrabă decât în ​​ferestrele noi.
  • Vă crește productivitatea cu 50% și reduce sute de clicuri de mouse pentru dvs. în fiecare zi!

 

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