# Last record in a row

#### Gregc

##### Board Regular
Is there an Excel function to return the last record in a row of data. I have dates in a row, 6 columns wide, I want to return the last date in the row.

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### Gregc

Thank you.

##### MrExcel MVP
On 2002-11-01 16:07, Gregc wrote:
Is there an Excel function to return the last record in a row of data. I have dates in a row, 6 columns wide, I want to return the last date in the row.

(1.) Activate Insert|Name|Define.
(2.) Enter BigNum as name in the Names in Workbook box.
(3.) Enter the following in the Refers to box:

9.99999999999999E+307

(4.) Click OK.

Now use...

=LOOKUP(BigNum,A2:F2)

If dates are in ascending order, you can also use...

=MAX(A2:F2)
This message was edited by Aladin Akyurek on 2002-11-01 16:27

#### Haluk

##### Rules Violation

On 2002-11-01 16:23, Aladin Akyurek wrote:

=LOOKUP(BigNum,A2:F2)

Aladin, i get an #N/A error when i enter the above formula ( with the numeric BigNum).

i don't know, what am i missing ?

##### MrExcel MVP
On 2002-11-01 17:15, Raider wrote:
On 2002-11-01 16:23, Aladin Akyurek wrote:

=LOOKUP(BigNum,A2:F2)

Aladin, i get an #N/A error when i enter the above formula ( with the numeric BigNum).

i don't know, what am i missing ?
LookupBigNum.xls
ABCDEF
1
21/2/20011/3/20011/4/20011/5/20011/6/2001
3
4
51/6/2001
Sheet1

This message was edited by Aladin Akyurek on 2002-11-01 17:22

#### Haluk

##### Rules Violation

strange but, still the same error. i give it up, its late here....thx again.

##### MrExcel MVP
On 2002-11-01 17:33, Raider wrote:

strange but, still the same error. i give it up, its late here....thx again.

Try also:

=INDEX(A2:F2,MATCH(BigNum,A2:F2))

Did you define BigNum as I described?

#### normpam

##### Active Member
Here's a shot at it from an amateur!

Assuming the data are in adjacent columns, try the following code:

Sub GetValue()
Range("B7").Value = Range ("B2").Offset.End(xlToRight).Value
End Sub

Replies
5
Views
95
Replies
3
Views
83
Replies
5
Views
113
Replies
9
Views
174
Replies
7
Views
84

1,148,179
Messages
5,745,199
Members
423,932
Latest member
pablo2

### 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.

### Which adblocker are you using?

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

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