ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   excel formula (https://www.excelbanter.com/excel-discussion-misc-queries/244450-excel-formula.html)

ghcajo

excel formula
 
can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


Jacob Skaria

excel formula
 
Try the below formula in B2 and copy down as required
=COUNTIF(C$2:C2,C2)

'OR to handle blanks try the below
=IF(C2<"",COUNTIF(C$2:C2,C2),"")

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:

can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


ghcajo

excel formula
 


"Jacob Skaria" wrote:

Try the below formula in B2 and copy down as required
=COUNTIF(C$2:C2,C2)

'OR to handle blanks try the below
=IF(C2<"",COUNTIF(C$2:C2,C2),"")

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:

can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


ALL THE COLUMN B CAME OUT TO 1,
I need it to add 1 if it was already listed.
See bob has 3 entries.

Jacob Skaria

excel formula
 
Did you try the formula?

Copy paste the formula to cell B2 and copy down as required..

Try and feedback

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:



"Jacob Skaria" wrote:

Try the below formula in B2 and copy down as required
=COUNTIF(C$2:C2,C2)

'OR to handle blanks try the below
=IF(C2<"",COUNTIF(C$2:C2,C2),"")

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:

can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


ALL THE COLUMN B CAME OUT TO 1,
I need it to add 1 if it was already listed.
See bob has 3 entries.


ghcajo

excel formula
 


"Jacob Skaria" wrote:

Did you try the formula?

Copy paste the formula to cell B2 and copy down as required..

Try and feedback

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:



"Jacob Skaria" wrote:

Try the below formula in B2 and copy down as required
=COUNTIF(C$2:C2,C2)

'OR to handle blanks try the below
=IF(C2<"",COUNTIF(C$2:C2,C2),"")

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:

can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


ALL THE COLUMN B CAME OUT TO 1,
I need it to add 1 if it was already listed.
See bob has 3 entries.



I just noticed that at the end of the formula the } is missing. I tried to
redo it and it will not show up.
If I look at the function argument the totals are right.

ghcajo

excel formula
 


"ghcajo" wrote:



"Jacob Skaria" wrote:

Did you try the formula?

Copy paste the formula to cell B2 and copy down as required..

Try and feedback

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:



"Jacob Skaria" wrote:

Try the below formula in B2 and copy down as required
=COUNTIF(C$2:C2,C2)

'OR to handle blanks try the below
=IF(C2<"",COUNTIF(C$2:C2,C2),"")

If this post helps click Yes
---------------
Jacob Skaria


"ghcajo" wrote:

can a formula be made to do the following:
if a line item has the same name in column C then add 1 to column B
i.e.
the count column is generated depending on the name field
date count name address
oct-1 1 bob 123 first st
oct 1 1 john 789 ave a
oct 5 1 ed 456 main st
oct 3 2 bob 123 first st
oct 2 1 bill 81 second st
oct 2 3 bob 123 first st


ALL THE COLUMN B CAME OUT TO 1,
I need it to add 1 if it was already listed.
See bob has 3 entries.



I just noticed that at the end of the formula the } is missing. I tried to
redo it and it will not show up.
If I look at the function argument the totals are right.



I saved the file. then reloaded it and the counts were correct.
THANKS


All times are GMT +1. The time now is 05:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com