# Help writing a VLOOKUP formula

#### j4ymf

##### Well-known Member
Hello

what i am after is if D5 cell is greater than the range of any B13 - O13 then the result is the next value

Results in F4, F6, F8

Hope this makes sence
many thanks

Jay

#### Attachments

• Screenshot 2021-03-13 075826.jpg
115.6 KB · Views: 13

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

#### jasonb75

##### Well-known Member
Just regular lookup would work better for that.
Excel Formula:
``=LOOKUP(\$D\$5,\$B\$13:\$O\$13,\$B14:\$O14)``
As you have decided to merge some of the cells the formula will break if you try to fill down, you will need to edit each one with the correct result row.

Please use XL2BB for posting your examples. Even with simple questions, screen captures are relatively useless. We can't view the image and type a reply at the same time, we have to keep clicking in and out of the image to check the details.

#### j4ymf

##### Well-known Member
Thank you Jason
that works as a look up but returns the wrong value, if my result is greater than the lookup give that as my result

0.15 and my answerr is 0.152 then select the next lookup
does that make sense

=LOOKUP(\$D\$5,\$B\$13:\$O\$13,\$B14:\$O14)
D5 result is B5*B7/1000000

#### j4ymf

##### Well-known Member
=LOOKUP(\$D\$5+.1,\$B\$13:\$O\$13,\$B14:\$O14)
Hello Jason.

+.1 works is that ok, is that what you would have done?

#### jasonb75

##### Well-known Member

Sorry, I didn't notice that part. It is preferable to have the lower limit in the the top row rather than the upper limit, 0 in B13, 0.0051 in C13, 0.011 in D13, etc.

It would also be advisable to add an extra column at the end for 1.0001 for anything exceeding the limits in the last column.

#### Fluff

##### MrExcel MVP, Moderator
Another option would be to use Xloookup
Excel Formula:
``=XLOOKUP(\$D\$5,\$B\$13:\$O\$13,B14:O14,"",1)``

#### j4ymf

##### Well-known Member

Thank you so much Jason and Fluff you are stars

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback.

#### jasonb75

##### Well-known Member
Cheers, @Fluff, I keep forgetting the extra options in xlookup.

#### j4ymf

##### Well-known Member
Hello Fluff / Jason

how would i change the formula in G8 ( =XLOOKUP(\$F\$8,\$B\$1:\$O\$1,B2:O2,"",1) to look up the value in cell C8 but change my range to B2:O4
is that an index match query or is it still an xlookup?

Thank you

#### Attachments

• Screenshot 2021-03-20 190629.jpg
132.1 KB · Views: 2

Replies
0
Views
403
Replies
7
Views
230
Replies
7
Views
184
Replies
2
Views
115
Replies
5
Views
172

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

1,151,607
Messages
5,765,396
Members
425,281
Latest member
tmoreira001

### 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.

### Which adblocker are you using?

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

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