# Grab number from column but not the last number

#### kdrennan

##### New Member
Hello All,

I have a workbook with multiple worksheets. I populate the main page with information from the other worksheets.
This has worked fine until I tried to grab a number (not the last number) from column that has a total at the bottom.

I want to populate cell J3 on the main page with the last entered number of column AD on sheet 8. column AD has a total at the bottom that I do not want. I just want the last number in the column above the total. there are a number of empty cells in-between but all are empty.

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### Peter_SSs

##### MrExcel MVP, Moderator
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I have assumed data will not go below row 1000 in column AD. You can adjust that number up or down if you want.
See if this does what you want.

Excel Formula:
``=LOOKUP(9.99E+307,AD1:INDEX(AD:AD,LOOKUP(9.99E+307,AD1:AD1000,ROW(AD1:AD1000))-1))``

#### Peter_SSs

##### MrExcel MVP, Moderator
If you have Microsoft 365, you could also try
Excel Formula:
``=INDEX(AD1:AD1000,LARGE(FILTER(ROW(AD1:AD1000),AD1:AD1000<>""),2))``

#### kdrennan

##### New Member
If you have Microsoft 365, you could also try
Excel Formula:
``=INDEX(AD1:AD1000,LARGE(FILTER(ROW(AD1:AD1000),AD1:AD1000<>""),2))``
I do have 365, this is not pointing to the sheet8? is that why it gives me a NA error

#### kdrennan

##### New Member

I would like to use the code that works on both 2019 and 365 though.. Where can I insert sheet name at?

#### kdrennan

##### New Member
I GOT IT, THANK YOU VERY MUCH

#### Peter_SSs

##### MrExcel MVP, Moderator
You're welcome. Glad you got it sorted.

Replies
9
Views
189
Replies
1
Views
125
Replies
0
Views
274
Replies
3
Views
177
Replies
6
Views
207

1,148,145
Messages
5,745,050
Members
423,917
Latest member
Frank1931

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