Lookup Question

missdeannamarie

New Member
Joined
Mar 31, 2014
Messages
25
Hello!

I am really hoping someone can help me out with an excel question I am stumped on! :)

I will do my best to try and explain what I am trying to accomplish. I have a file with 3 different tabs. Tabs 2&3 are purely informational, which I want to pull data from. I need a formula that will take two selections from Tab 1, and reference those in Tabs 2&3 in order to pull the correct data. Each tab has column headers.

Here is what I am trying to do:

In Tab 1, when a customer is entered (Tab 1: Col B), I'd like a formula that will look up that customer in tab 2 (Tab 2: Col A), and find what freight rate they are assigned (Tab 2: Col B), then based on the type of freight entered in tab 1 (Tab 1: Col C), it would take the rate that is assigned to the customer and enter in the rate that corresponds to the freight type in tab 3 (Tab 3: Col B-F). I'd like that data returned in (Tab 1: Col J)

Basically, I need the rate in Tab 1: Col J to change based on the customer chosen.

I'd appreciate any help!!! Thanks!!!


TAB 1 - DATA
ABCDEFGHI JK
1DATE SHIPPED CUSTOMER TYPE OF FREIGHTITEMS DELIVERED: COMMENTS/DETAILS QTY UNIT OF MEASURE LENGTH (FT) WIDTH (FT) SQ. FT. CALC. RATE COST
21/17/2017CUSTOMER ATYPE AABC1.00ea
31/18/2017CUSTOMER BTYPE BDEF1.00ea
41/19/2017CUSTOMER CTYPE CGHI1.00ea
51/20/2017CUSTOMER DTYPE DJKL1.00ea
61/21/2017CUSTOMER ETYPE EMNO1.00Sq Ft
71/22/2017CUSTOMER FTYPE FPQR1.00Sq Ft
81/23/2017CUSTOMER GTYPE GSTU1.00Sq Ft

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

TAB 2 - CUSTOMERS
ABCDEFG
1CustomerRATE TYPEAddressPhoneEmailAttachmentsNotes
2CUSTOMER ARATE 1555, FAKE LANE, WA 55555555-555-5555ABC@ABC.COM
3CUSTOMER BRATE 2123, FAKE LANE, WA 55555555-555-5556ABC@ABC.COM
4CUSTOMER CRATE 3777, FAKE LANE, WA 55555555-555-5557ABC@ABC.COM
5CUSTOMER DRATE 4888, FAKE LANE, WA 55555555-555-5558ABC@ABC.COM
6CUSTOMER ERATE 5999, FAKE LANE, WA 55555555-555-5559ABC@ABC.COM
7CUSTOMER FRATE 1111, FAKE LANE, WA 55555555-555-5510ABC@ABC.COM
8CUSTOMER GRATE 1222, FAKE LANE, WA 55555555-555-5511ABC@ABC.COM

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


TAB 3 - RATES

ABCDEFG
1Freight TypeRATE 1RATE 2RATE 3 RATE 4 RATE 5 Unit of Measure
2TYPE A$15.00$20.00$20.00$25.00$40.00ea
3TYPE B$35.00$40.00$40.00$45.00$70.00ea
4TYPE C$35.00$40.00$40.00$45.00$70.00ea
5TYPE D$15.00$20.00$20.00$25.00$40.00ea
6TYPE E$1.65$1.85$1.85$2.65$8.60Sq Ft
7TYPE F$1.65$1.85$1.85$2.65$8.60Sq Ft
8TYPE G$1.85$2.00$2.00$2.65$8.60Sq Ft

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

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
where sheet3 has your rates sheet2 has your customers and sheet1 data
in J2 and copy down
Code:
=INDEX(Sheet3!$B$2:$F$8,MATCH(Sheet1!C2,Sheet3!$A$2:$A$8,0),MATCH(VLOOKUP(B2,Sheet2!$A$2:$B$8,2,0),Sheet3!$B$1:$F$1,0))
 
Upvote 0
where sheet3 has your rates sheet2 has your customers and sheet1 data
in J2 and copy down
Code:
=INDEX(Sheet3!$B$2:$F$8,MATCH(Sheet1!C2,Sheet3!$A$2:$A$8,0),MATCH(VLOOKUP(B2,Sheet2!$A$2:$B$8,2,0),Sheet3!$B$1:$F$1,0))


Thanks for the help but I am getting a #N/A return. Any ideas on why?
 
Last edited:
Upvote 0
Sounds like one of the match functions is not finding a match.

In edit mode highlight the red part and press F9 to evaluate it do the same with the blue part. DO NOT press enter use escape. When you evaluate it will return the results of the formula so you know what is causing the #NA error. Check the cell references to make sure they are correct for your data.
Code:
=INDEX(Sheet3!$B$2:$F$8,[COLOR=#ff0000]MATCH(Sheet1!C2,Sheet3!$A$2:$A$8,0)[/COLOR],[COLOR=#0000CD]MATCH(VLOOKUP(B2,Sheet2!$A$2:$B$8,2,0),Sheet3!$B$1:$F$1,0)[/COLOR])
 
Upvote 0
Sounds like one of the match functions is not finding a match.

In edit mode highlight the red part and press F9 to evaluate it do the same with the blue part. DO NOT press enter use escape. When you evaluate it will return the results of the formula so you know what is causing the #NA error. Check the cell references to make sure they are correct for your data.
Code:
=INDEX(Sheet3!$B$2:$F$8,[COLOR=#ff0000]MATCH(Sheet1!C2,Sheet3!$A$2:$A$8,0)[/COLOR],[COLOR=#0000CD]MATCH(VLOOKUP(B2,Sheet2!$A$2:$B$8,2,0),Sheet3!$B$1:$F$1,0)[/COLOR])




That worked! The error was in the red. I was able to fix it. Thanks for the help, you are a life saver!!!
 
Upvote 0

Forum statistics

Threads
1,215,206
Messages
6,123,638
Members
449,109
Latest member
Sebas8956

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