How can I use LOOKUP, INDEX or MATCH (or any other lookup method) in this table when the values in Col C are for example "3900 kWh to 4,199 kWh"

Canjosa

New Member
Joined
Oct 9, 2013
Messages
2
The screen shot is one of a number of different tables that are nominated as "lookup tables". But column C is not a single value but a range.
I want to look up say 1550kWh (which will be just 1550) to find the corresponding values in the columns to the right. Is there a way to do this"

Thanks for your help!
Screenshot 2023-08-17.jpg
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Assuming col C is always in ascending order, you could add a helper column like col D in the example below and then use that column for lookup or match setting the match type to true (or 1). There may be better ways to do this depending on what version of Excel you are using.
Book1
CD
9Energy Limit in kWh
100 kWh to 299 kWh299
11300 kWh to 599 kWh599
12600 kWh to 899 kWh899
13900 kWh to 1,199 kWh1199
Sheet1
Cell Formulas
RangeFormula
D10:D13D10=MID(SUBSTITUTE(SUBSTITUTE(C10," kWh","")," to ",","),SEARCH(",",SUBSTITUTE(SUBSTITUTE(C10," kWh","")," to ",","))+1,LEN(C10))+0
 
Upvote 0
if you split the column with value ranges into two columns the VLOOKUP function would work well for your

Here is a short example. Your source table looks something like this ...
KWHSplit.xlsx
ABC
1kWhDataData2
20 kWh to 299 kWh
3300 kWh to 599 kWh
4600 kWh to 899 kWh
Source Table


In another sheet or a different location on the same sheet split out the text ranges of values using a formula like the following
KWHSplit.xlsx
ABCD
1KWHDataData2
20299
3300599
4600899
Split Table
Cell Formulas
RangeFormula
A2:A4A2=VALUE(LEFT('Source Table'!A2,FIND(" to ",SUBSTITUTE('Source Table'!A2, " kWh", ""))-1))
B2:B3B2=VALUE(SUBSTITUTE(MID('Source Table'!A2, FIND(" to ", 'Source Table'!A2)+4,10)," kWh",""))
B4B4=VALUE(SUBSTITUTE(MID('Source Table'!A4, FIND(" to ", 'Source Table'!A4)+4,11)," kWh",""))


then use
=VLOOKUP ( value, range of the table with split values, n, true)

this is a different version of using helper columns
 
Upvote 0

Forum statistics

Threads
1,215,345
Messages
6,124,408
Members
449,157
Latest member
mytux

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
Back
Top