Lookup a non natural number eg 4-1020 within a range and return value in next column

Dares2

New Member
Joined
Feb 27, 2017
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hello this is probably quite simple but I am looking at a vlookup that finds if a non natural number eg 4-4402 is within a range (column a and b) and returns the value in column c

4-4402
4-10004-3199Service Agreements - Recurring
4-32004-3300Service Agreements - Non Recurring
4-46804-4699Fees from Training Activities
4-45414-4545Corporate Partnerships
4-44004-4499Donations Received
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Does this do what you want?

24 11 12.xlsm
ABCDEF
1Lookup ValueResult
24-10004-3199Service Agreements - Recurring4-4402Donations Received
34-32004-3300Service Agreements - Non Recurring4-4501N/A
44-46804-4699Fees from Training Activities5-3250N/A
54-45414-4545Corporate Partnerships4-3250Service Agreements - Non Recurring
64-44004-4499Donations Received4-4546N/A
74-4545Corporate Partnerships
Check Range
Cell Formulas
RangeFormula
F2:F7F2=FILTER(C$2:C$6,(E2>=A$2:A$6)*(E2<=B$2:B$6),"N/A")
 
Upvote 0
Does this do what you want?

24 11 12.xlsm
ABCDEF
1Lookup ValueResult
24-10004-3199Service Agreements - Recurring4-4402Donations Received
34-32004-3300Service Agreements - Non Recurring4-4501N/A
44-46804-4699Fees from Training Activities5-3250N/A
54-45414-4545Corporate Partnerships4-3250Service Agreements - Non Recurring
64-44004-4499Donations Received4-4546N/A
74-4545Corporate Partnerships
Check Range
Cell Formulas
RangeFormula
F2:F7F2=FILTER(C$2:C$6,(E2>=A$2:A$6)*(E2<=B$2:B$6),"N/A")
Thankyou for this. I seem to get a spill error from this formula. Im not sure why. Either way I think I have solved it with an xlookup formula
 

Attachments

  • xlookup.jpg
    xlookup.jpg
    75 KB · Views: 3
Upvote 0
I seem to get a spill error from this formula.
That should only happen if the value being looked up (the value in column E in my layout) fitted into more than one of the groups in columns A:B. Could that be a possibility?
If so, which result should be returned?

It would be good to see a small set of sample data with XL2BB that shows the spill error with my formula.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)

In the interim it would be interesting to know if this modification returned the correct results for you.

24 11 12.xlsm
ABCDEF
1Lookup ValueResult
24-10004-3199Service Agreements - Recurring4-4402Donations Received
34-32004-3300Service Agreements - Non Recurring4-4501N/A
44-46804-4699Fees from Training Activities5-3250N/A
54-45414-4545Corporate Partnerships4-3250Service Agreements - Non Recurring
64-44004-4499Donations Received4-4546N/A
74-4545Corporate Partnerships
Check Range
Cell Formulas
RangeFormula
F2:F7F2=TAKE(FILTER(C$2:C$6,(E2>=A$2:A$6)*(E2<=B$2:B$6),"N/A"),1)
 
Upvote 0
I seem to get a spill error from this formula.
To check, I have set up data with the layout and codes as shown in your image in post 3 and adapted the ranges in my post 2 formula to suit that layout and I don't get any spill error.

24 11 12.xlsm
ABCDEFG
1
2
34-3101A4-10004-3199A
44-4425G4-32004-3300B
54-4543F4-34004-3400C
64-4510H4-34204-3420D
74-4511H4-46804-4699E
84-4541F4-45414-4545F
94-4545F4-44004-4499G
104-4544F4-45004-4540H
114-4543F4-46004-4679I
124-47154-4715J
134-47204-4720K
144-47104-4710L
Check Range (2)
Cell Formulas
RangeFormula
C3:C11C3=FILTER(G$3:G$14,(A3>=E$3:E$14)*(A3<=F$3:F$14),"N/A")
 
Upvote 0
Solution
thanks for your help @Peter_SSs
. I tried the filter range and it did work. As I had worked it out though with a xlookup I used this as it was solved. Appreciate you looking at it.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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