# Selecting index position of data from a table that is less than a certain value

I have a table of numbers with a few thousand entries, and I'm trying to find the first index that is less than a particular value. An example of the table I'm working on is as follows:

dr = {6.34152*10^8, 6.32076*10^8, 6.29998*10^8, 6.27921*10^8, 6.25843*10^8, 6.23765*10^8, ...}


What I'm trying to do is find the first entry that is less than 5.77*10^8. I've tried the following:

SOIdr = Position[dr, First[dr] < 5.77*10^8]


But have had no luck thus far. Any help would be appreciated, thanks guys.

This question is closely related to a number of others, if not an outright duplicate, but I can't find that duplicate now. Your syntax for using Position is not correct. You need something like this:

dr = {4, 7, 4, 8, 8, 5, 3, 4, 5, 4, 5, 5};
val = 4;

Position[dr, x_ /; x < val, 1, 1]

{{7}}


For numeric operations there are usually faster methods however. I am looking for a Q&A that gives some examples.

• Thank you Mr. Wizard, worked like a charm. – InquisitiveInquirer Mar 17 '14 at 12:00
dr = {4, 7, 4, 8, 8, 5, 3, 4, 5, 4, 5, 5};
val = 4;