What formula to use "if" function cant sustain the list? Lookup doesn't help

DavidRoger

Board Regular
Joined
Oct 2, 2011
Messages
135
All the data is not sorted and filled one by one in order throughout.


1 3000
2 2950
3 2700
4 3000
.
.
.
59 2350
60 2400


if there is not data in row 60, the formula should show data in row 59 and so on.

The problem is "if" can't fulfill all the condition.
"Lookup" doesn't fit also.
How can the problem to solve?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
All the data is not sorted and filled one by one in order throughout.


1 3000
2 2950
3 2700
4 3000
.
.
.
59 2350
60 2400


if there is not data in row 60, the formula should show data in row 59 and so on.

The problem is "if" can't fulfill all the condition.
"Lookup" doesn't fit also.
How can the problem to solve?

Try...

=LOOKUP(9.99999999999999E+307,A:A)
 
Upvote 0
Your formula solve the problem.

If you dont mind, please brief what is 9.99999999999999E+307.

Here are some links on the subject:

http://www.mrexcel.com/forum/excel-questions/102091-9-9999999-a.html (post #3 and #5)

LOOKUP, and kindred functions with match-type set to 1, using this big number (largest number allowed to be typed into a cell in Excel), will land on the last numeric value in the reference it's given (A:A, 4:4, E2:E25, C4:K4), irrespective of whether the reference is sorted in ascending order. This is a description by effect, not an algorithm. I describe the algorithm involved in:

http://www.mrexcel.com/forum/excel-questions/310278-vlookup-multiple-matches-match-returned.html (post #7)

By the way, the big number is often contracted to 9.99E+307 (in analogy to the number π [Pi]).

The equivalent look up value for text, BigStr, due to Mark W., created here at mrexcel, is:

REPT("z",255)

which is often used in a LOOKUP expression in order to find the last text value in a reference as in:

=LOOKUP(REPT("z",255),A:A)

Big Thanks.

You are welcome.
 
Upvote 0
Hmm?
=LOOKUP(REPT("z",255),A:A) fails if the last string is longer than 255 characters and 255 can't be increased.

ISTEXT() recognises long strings, but not when used in =MAX(INDEX(ISTEXT(A1:A65535)*ROW(A1:A65535),,1))

65535 is the number of rows in 2003 minus 1

This table has been modified to suit the forum, when you apply the formula you will see the results.

Once done enter any text in say A15

It seems to me that LOOKUP(REPT("z",255),A:A) is potentially more fragile than using 99^99 as "BigNo"

Excel Workbook
ABCDEF
1DataString Lengthaaaaaaaaaaaaaaaa???
2xxxx4
3xxxxxxxxx913aaaaaaaaaaaaaaaa
4xxxxxxxxxxxxxxxx16
5xxxxxxxxxxxxxxxx.2513aaaaaaaaaaaaaaaa
6xxxxxxxxxxxxxxxx.36
7xxxxxxxxxxxxxxxx.49
8xxxxxxxxxxxxxxxx.64
9xxxxxxxxxxxxxxxx.81
10xxxxxxxxxxxxxxxx.100
11xxxxxxxxxxxxxxxx.121
120
13aaaaaaaaaaaaaaaa256
14
15
16
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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