Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop a formula in Excel?

Status
Not open for further replies.

groovygarden

Programmer
Aug 23, 2001
63
0
0
Hi

Hope I explain this OK....

How can I seach through a list of values in a spreadsheet column until i find a value which matches one that I specify. I have the basic IF statement: =IF(C2 = A2,B2). Where C2 holds the value I'm trying to find, A2 holds a value which might be a match and B2 is what i want returned if the statement is TRUE. If A2 didn't match C2 I'd want to run a formula which said: =IF(C2 = A3,B3). And if that didn't match: =IF(C2 = A4,B4) and so on (hope this is making sense!)

Column A holds 6000 values so a nested IF / ELSE IF can't be used (I think). Is there a way I can loop the formula and increment A* and B* until a match is found?

Thanks
 
Using the VLOOKUP function, for example:

=VLOOKUP(C2,A1:B6000,2,FALSE)



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top