Last record in a row

Gregc

Board Regular
Joined
Apr 24, 2002
Messages
75
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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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)

Adjust the range to suit.

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
Joined
Oct 26, 2002
Messages
1,075

ADVERTISEMENT

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

=LOOKUP(BigNum,A2:F2)

Adjust the range to suit.

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 ?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-11-01 17:15, Raider wrote:
On 2002-11-01 16:23, Aladin Akyurek wrote:

=LOOKUP(BigNum,A2:F2)

Adjust the range to suit.

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
Joined
Oct 26, 2002
Messages
1,075

ADVERTISEMENT

thx, Aladin.

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

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-11-01 17:33, Raider wrote:
thx, Aladin.

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
Joined
Oct 30, 2002
Messages
299
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
 

Forum statistics

Threads
1,148,171
Messages
5,745,173
Members
423,931
Latest member
thangvan114

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
Top