Correlative numbers formula in Apple Numbers I have text in column B. But there are some columns that are empty. There is no rule the empty raws are at random. This is what I have now:



I want to have correlative numbers in column A. The problem is to detect the empty raws. That should be the result:
Enter a 1 in the cell A1.
Insert the following formula into cell A2.

IF(ISBLANK(B2),"",MAX(A$1:A1)+1)


This formula checks the cell to the right to see if it is blank. If it is blank, the cell in the A column should be blank too. If not, the cell should be filled with the next integer, which equates to the maximum integer reached so far + 1.
Fill the rest of the A column using this formula. Use the yellow fill handle so that the formula is adjusted correctly as it fills. The $ sign fixes the first cell of the range used by the MAX function.