One formula to look at a number of rows in column C and return the last entry

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
Hi

I would like to use a formula to find the following;

Starting from cell c10 and ending at cell c100, I want to find where cell c10 is not equal to "" and the cell directly below in this case c11 is equal to "", if so I want to return the contents of cell c10. I want to repeat this process down to cell c100 only if the last entry and the cell below it is equal to "". The last entry could be cell c99 and cell c100 is equal to "" then I would like to return the contents of c99.

Regards,
suprsnipes
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Something like:

=LOOKUP(2, 1/(C10:C100<>""), C10:C100)

Excel Workbook
BCDEFGH
3
4517
510
615
720
825
930
1035
1140
1217
13
Sheet1
 
Upvote 0
Hi

I would like to use a formula to find the following;

Starting from cell c10 and ending at cell c100, I want to find where cell c10 is not equal to "" and the cell directly below in this case c11 is equal to "", if so I want to return the contents of cell c10. I want to repeat this process down to cell c100 only if the last entry and the cell below it is equal to "". The last entry could be cell c99 and cell c100 is equal to "" then I would like to return the contents of c99.

Regards,
suprsnipes

If C10:C100 is numeric, the last numeric value can be retrieved with:

=LOOKUP(9.99999999999999E+307,C10:C100)

If C10:C100 is text, the last text value that is not a blank (i.e., "") can be retrieved with:

=LOOKUP(9.99999999999999E+307,SEARCH("?",C10:C100),C10:C100)

Any non-blank non-error value, again with:

=LOOKUP(9.99999999999999E+307,1/(1-(C10:C100="")),C10:C100)

The 2nd would actually do the same as the third.
 
Last edited:
Upvote 0
Hi

I would like to use a formula to find the following;

Starting from cell c10 and ending at cell c100, I want to find where cell c10 is not equal to "" and the cell directly below in this case c11 is equal to "", if so I want to return the contents of cell c10. I want to repeat this process down to cell c100 only if the last entry and the cell below it is equal to "". The last entry could be cell c99 and cell c100 is equal to "" then I would like to return the contents of c99.

Regards,
suprsnipes
There are several ways to do this. The best solution depends on what type of data is in the range.

Is the data in the range:

text
numbers
dates
times
logical values like TRUE and/or FALSE

Are there any formulas in the range?

Do any of these formulas return formula blanks (="")?

Do any of these formulas return errors?

Could the data in the range be all of the above?
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,904
Members
452,948
Latest member
Dupuhini

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