Generating a Record Number when another cell is not blank

Mettaya1

New Member
Joined
Oct 8, 2013
Messages
20
I can't get this simple function to work.
I know that;

=ROW($A2)-1

Returns the row number just fine if I write it into the cell and drag it.

As I prefer to use conditional formatting if a cell is doing something I am trying to make the following work.

=IF(($B2)<>"",ROW($A2)-1)

I need the row number to be the actual record and not include the first row which is a heading hence the -1.

Regards

Steve
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
For actual numbering if the cell is non blank, try this:

Must be input in cell A2:
=IFERROR(IF(B2="","",COUNTIF($A$1:A1,">0")+1),"")

and try it fill up data on Column B, and try to skip it with blank
 
Upvote 0
I'm not sure what you are trying to do here. Do you want to

enter a formula in another column eg "C" that returns the row# if "B" is non-blank ?

OR

format a column (any column A,B,C , etc ) based on the value in "B" ? eg make Cell A2 bold if Cell B2 is not blank
[TABLE="width: 218"]
<TBODY>[TR]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]




<TBODY>
</TBODY>

[/TD]
[/TR]
[TR]
[TD="align: right"]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD][/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
</TBODY>[/TABLE]
 
Last edited:
Upvote 0
The formula copied down as necessary

Hi,
What I am trying to do is replace the Row numbers with a generated Record Number.

The First Row (1) is used by the headings and if I need to move a record up or down I have to manually change all the record numbers.
I want to use a function that in Column A generates the correct record number
 
Upvote 0

Forum statistics

Threads
1,223,707
Messages
6,174,000
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top