Match then vlookup with 2 nested if functions

groud

New Member
Joined
Jul 24, 2013
Messages
7
A1B1C1D1E1F1G1H1I1J1
2Typeresultvlookup resultTypeReturn CodeLine ItemLow ToleranceHigh Tolerance
3A91011010A1010Cash91009119
4A91821050A1020Taxes Receivable91209139
5L94672010A1030Account Receivable91509169
6L94882030A1040Inventory91709179
7R22003020A1050Prepaids91809999
8R51003080A1060Due From91409149
9E19004010L2010Salaries94609479
10E53264070L2020Accounts Payable94209429
11L2030Unearned Revenue94809499
12L2040Retainage Payable94309439
13L2060Due to94009419
14R3010Local Revenue10001999
15R3020Intermediate Revenue20002999
16R3030State Revenue30003999
17R3040Federal Revenue40004999
18R3050Other Sources50005099
19R3060Transfers In52005299
20R3070Sale of Capital Assets53005399
21R3080LTD Proceeds51005199
22R3999Beginning Fund Balance54005499
23E4010Instruction10001999
24E4020Support20002999
25E4030Community Services30003999
26E4040Facilities and Construction40004999
27E4050Debt Service51005199
28E4060Transfers Out52005299
29E4070Capital Outlay53005499

<colgroup><col><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>

<tbody>
</tbody>


Ok, So I want to lookup the type column in row B "A,L,R,E" and match it with the type column in column F, then return the "return code" for the code in column B that falls between the two tolerance columns in column I and J. I want this to be the equation in column D (which has the correct values that I would like it to return).

For example if the value in column B is "E" and the code in column C is "5201", I'd like the value returned to column D to find the match in column F of "E" and find the row that the code falls between the two tolerances, in this case "e" and "5201" fall within row 28 where the return code would be "4060"
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi and welcome to Mr Excel Forum

Try

D3
=IF(B3<>"",INDEX($G$3:$G$29,MATCH(1,INDEX(($F$3:$F$29=B3)*(C3>=$I$3:$I$29)*(C3<=$J$3:$J$29),0),0)),"")
copy down

M.
 
Upvote 0
You sir, are a lord. Thanks. I've only been trying to figure this on out for the last 2 days. Where did you do your learning?

I originally got "#N/A " in D3 ... then I copied down and it worked for those cells. But still not D3. So I changed the code in C3 and then D3 for some reason worked.
 
Upvote 0
You sir, are a lord. Thanks. I've only been trying to figure this on out for the last 2 days. Where did you do your learning?

I originally got "#N/A " in D3 ... then I copied down and it worked for those cells. But still not D3. So I changed the code in C3 and then D3 for some reason worked.

You are welcome and thanks for the feedback

M.
ps: I suspect that there was extraneous spaces in C3, because the formula worked as expected when you has inserted a new value..
 
Upvote 0

Forum statistics

Threads
1,215,103
Messages
6,123,107
Members
449,096
Latest member
provoking

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