Counting untill it is False, and continue

Copper Contributor

Im am completly new to excel and this community, So I say a big HELLO to you all. The question is. How do I count the same numbers untill it is not true.

4.00 1
4.00 2
4.00 3
-12.00 1
-12.00 2
-12.00 3
-12.00 4
4.00 1
4.00 2
-12.00 1
4.00 1
-12.00 1
-12.00 2
4.00 1
-12.00 1
-12.00 2
-12.00 3
4.00 1
-12.00 1
4.00 1

14 Replies
Hello,

You're welcome to this big community. To your question, it is quite unclear.. Kindly re-work the question preferably with sample data.

Regards

@Abiola1 

 

well ...  Im gonna type the same thing accually.

 

If the first cell is A, and the next below is also A, now what I want is to the next column a 2.

If the third cell is also A, I want a 3 in the next column.

If the fourth cell is B I want a 1 in the next column. Because it is the first B.

If the fifth cell is a A again then the next column puts an 1 again. So it count again.

If the 6 cell is a A again the next column needs a 2.

a  1

a  2

a  3

b  1

a  1

a  2

b  1

a  1

a  2

b  1

a  1

a  2

b  1

b  2

b  3

a  1

 

But I have number instead 4.00  and the -12.00.

@Abiola1 

So my data is only this 

4.00
4.00
4.00
-12.00
-12.00
-12.00
-12.00
4.00
4.00
-12.00
4.00
-12.00
-12.00
4.00
-12.00
-12.00
-12.00
4.00
-12.00
4.00

 

@venomtoxin 

 

If anyone doesnt understand please tell me. Im new to this community.

 

it can be also like this, maybe this is simpler

4.00   
4.00
4.00               3
-12.00
-12.00
-12.00
-12.00           4
4.00
4.00               2
-12.00           1
4.00               1
-12.00
-12.00           2
4.00               1
-12.00
-12.00
-12.00           3
4.00               1
-12.00           1
4.00               1

I really thank for the people to help me with this. Have a great day.

Your question is logical related.
Let say you have A, B, A, C in cells A1 to A4.

If cell B1, you can write an IF formula thus:
=IF(A1="A",1,IF(A1="B",2,3)). Click enter and copy down the formula.

What the above implies is that:
All cells with A in column A will return 1 in column B.
All cells with B in column A will return 2 in column B, and so on.

I guess that is what you're trying to achieve.

@Abiola1 

COLUMNS A and B

A            B

a            

a

a             3

b             

b             2

a             1

b             1

a             1

b             1

 

or something like this 

A            B

a            1

a            2

a            3

b            1             

b             2

a             1

b             1

a             1

b             1

He is counting more if it is the same, if it is not the same start again. COUNTING IN A ROW, not the row in excel language, but we normally say count in a row. 

 

Thank you for responding,  I need this help really. Il wait for an answer

 

@venomtoxin 

here is the data And I want B to fill with the result, as you can see we have 3 4.00 in the first 3 cells so in the B3 we need a 3,   and from A4 to A7 we need a 4 in B7. And A8 To A9 we have again the same 4.00. So we need a 2 at B9. Thank you.  Please help me with this 

@venomtoxin 

To simplify, put 1 in B1

image.png

in B2

=IF(A2=A1,B1+1,1)

and drag it down

@Sergei Baklan 

 

Can you do it for me,  I failed with the drag drop thing man im sorry. A BIG Thanks for helping. Im very beginner to this job. 

OMG ITS WORKING I GET IT. I watched some tutorial, I hover my mouse to the edge, HOLD CTRL + LeftMouseButton, and copy on the next B Column,  and it counts it perfectly. But now is the question, Can I automate this, as you can see there is a lot to copy   CTRL + SHIFT +LEFTMOUSEBUTTON dind't work. THANKS MAN, Im waiting for a answer

@venomtoxin 

At least couple of ways

1) 

image.png

Stay on the cell, left click the dot at right bottom corner, keeping left button of the mouse pressed drag down, release the button. Result is

image.png

2) Stay on the cell with formula and select all cells till end of the range (e.g. press Shift and sequentially PgDown)

image.png

Press Ctrl+D. Result is

image.png

 

@Sergei Baklan 

 

I REALLY THANK YOU. Thank you very much. You are golden.

@venomtoxin 

That's couple of clicks job for entire range, nothing to automate. Left click on corner of the cell, move down, release the button. If you have relatively big range, dragging the cell move it to tasks bar area, it will go much faster

image.png

With Ctrl+D you may, staying on the cell, type in reference bar reference on entire range to select it, Enter, Ctrl+D. That's all

image.png

@venomtoxin , you are welcome