Help writing a VLOOKUP formula

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
664
Office Version
  1. 365
Platform
  1. Windows
Hello

Could you please help me write a VLOOKUP formula
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
    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
Joined
Dec 30, 2008
Messages
14,607
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Apr 28, 2003
Messages
664
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Apr 28, 2003
Messages
664
Office Version
  1. 365
Platform
  1. Windows
=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
Joined
Dec 30, 2008
Messages
14,607
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
Another option would be to use Xloookup
Excel Formula:
=XLOOKUP($D$5,$B$13:$O$13,B14:O14,"",1)
 

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
664
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Thank you so much Jason and Fluff you are stars :)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
664
Office Version
  1. 365
Platform
  1. Windows
Hello Fluff / Jason

Could i please ask another favor

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
    Screenshot 2021-03-20 190629.jpg
    132.1 KB · Views: 2
Learn Excel from Bill Jelen

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

Forum statistics

Threads
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.
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
Top