'How do I increment an Excel formula but with a condition?

My excel formula is

=LOOKUP(G10,A1:A50,B1:B50)

What I like to do is increment G10, but not the next formula.

=LOOKUP(G11,A1:A50,B1:B50)
=LOOKUP(G12,A1:A50,B1:B50)
=LOOKUP(G13,A1:A50,B1:B50)

and so on.



Solution 1:[1]

try:

=ARRAYFORMULA(LOOKUP(G10:G13, A1:A50, B1:B50))

or:

=ARRAYFORMULA(LOOKUP(G10:G, A1:A50, B1:B50))

Solution 2:[2]

You have to use an absolute reference. so what you need is this: =LOOKUP(G10,$A$1:$A$50,$B$1:$B$50)

For more information about absolute you can read here: https://support.microsoft.com/en-us/office/overview-of-formulas-in-excel-ecfdc708-9162-49e8-b993-c311f47ca173

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 player0
Solution 2 Nikola Ganev