ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   assign next serial number based on contents of another cell (https://www.excelbanter.com/new-users-excel/240471-assign-next-serial-number-based-contents-another-cell.html)

Clint

assign next serial number based on contents of another cell
 
column A titled "serial number", column B titled "line item", column C titled
"cargo".
If column B contains 5 line items for the same cargo in column C, how do I
get column A to input the next serial number only after contents in Column C
has changed.




Per Jessen

assign next serial number based on contents of another cell
 
Hi

Enter first serial number in A2, then insert this formula in A3 and copy
down. If cargo cell is empty, serial number cell will also be empty.

=IF(C3<"",IF(C3<C2,A2+1,A2),"")

Hopes this helps.
....
Per

"clint" skrev i meddelelsen
...
column A titled "serial number", column B titled "line item", column C
titled
"cargo".
If column B contains 5 line items for the same cargo in column C, how do I
get column A to input the next serial number only after contents in Column
C
has changed.





pshepard

assign next serial number based on contents of another cell
 
Hi Clint,

To increment one number in the serial number column when:

1. Cargo text field changes

OR

2. Above the current row there are 5 lines with the same cargo text as the
current row, AND those rows have the same serial number as the preceding row.

In cell A2 enter first serial number - i.e. 1001.

In cell A3 enter:

=IF(C2<C3,A2+1,IF(COUNTIF(INDIRECT("C"&MATCH(A2,A :A,0)):C3,C3)5,A2+1,A2))

Hope this helps.

Peggy

"clint" wrote:

column A titled "serial number", column B titled "line item", column C titled
"cargo".
If column B contains 5 line items for the same cargo in column C, how do I
get column A to input the next serial number only after contents in Column C
has changed.





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

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