# 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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

#### 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
180
Replies
3
Views
121
Replies
5
Views
169
Replies
9
Views
228
Replies
7
Views
88

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

1,151,575
Messages
5,765,188
Members
425,266
Latest member
CPAgirl

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