Find first non #N/A value in either direction

y3tter

Board Regular
Joined
Nov 11, 2012
Messages
147
In Column B1:B14 there are values for relative distance in elevation, which are divided in 14 zones. If you are moving down in elevation the #N/A's will be at the top zones, if you begin moving up in elevation #N/A's will be at the bottom. Basically any zone that is not in the direction in which you are moving will be #N/A. How can you find the the first real value that is not a #N/A, by first looking for if the #N/A is at the top or bottom of the column and then returning the first value after the #N/A. Also, if you are in Zone1 moving down there will be no #N/A's and if you are in Zone14 moving up there will be no #N/A's. There shouldn't be any instance of moving up out of Zone1 or below Zone14.

Below is an example of the 14 zones, the second column would be moving down in elevation while being in Zone6, and the third column is an example of moving up and being in Zone10.


Zone1#N/A87
Zone2#N/A77
Zone3#N/A65
Zone4#N/A50
Zone5#N/A46
Zone61039
Zone71033
Zone82220
Zone9256
Zone10356
Zone1142#N/A
Zone1256#N/A
Zone1366#N/A
Zone1478#N/A

<tbody>
</tbody>
 
That worked, but unfortunately the workbook has VBA that not only deletes the previous set of data but also the table when a new sheet is created. The workbook has a password and I don't have access to it.

Would it be possible to look at column B1:B14 and see if it is going in sequential order, has less than 14 values, and if so use the indexed value of one cell higher than what is being returned. Otherwise, if it has all 14 values in B1:B14 the formula works great.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Could Offset counta be used to create a dynamic range instead of defining it B1:B14? Both columns A and B will have the same amount of values displayed, even in the instance when there are less than 14 values.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,696
Members
449,048
Latest member
81jamesacct

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