Trying to use 2 VLookup formulas but need a "Then".....

BankBob

New Member
Joined
Jan 4, 2019
Messages
8
=IFerror(VLOOKUP(E3,_20181219_milly_final_2!$B$2:$H$175466,7,0),iferror(VLOOKUP(J3,_20181219_milly_final_2!$G$2:$H$175466,2,0)))

Here is a formula that is not working --- I have 2 tabs and each tab contains account # and element #. I am trying to match acct # from tab 1 to acct #on tab 2 and same with the element #. Once these both match, I want to get the fee that is a result of the double match. Each tab has approx. 60,000 rows of data. I put together 2 separate vlookups, but am not sure how to tie them together and add a "THEN" statement.

Any ideas or solutions would be greatly appreciated!

Thank you!!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If you want the same row matched on both, you need to include them both in the condition. Otherwise, you're most likely finding two disparate rows. To do this you'll need an array formula. The below is confirmed with CTRL+SHIFT+ENTER instead of just ENTER. Make sure you only have one cell selected when you enter it. Excel will add the curly brackets around the formula when you enter it, signifying it's entered correctly as an array formula:
Code:
=INDEX(_20181219_milly_final_2!$H$2:$H$175466,MATCH(E3&J3,_20181219_milly_final_2!$B$2:$B$175466&_20181219_milly_final_2!$G$2:$G$175466,0))
 
Upvote 0
You might also consider a non-array SUMIFS:

=SUMIFS(_20181219_milly_final_2!$H:$H,_20181219_milly_final_2!$B:$B,E3,_20181219_milly_final_2!$G:$G,J3)
 
Last edited:
Upvote 0
As long as the resultant is numeric (I'd assume "fee" would be though).
 
Upvote 0
I like the sumifs idea. Here is an example. Maybe you can help me write the formula? When I tried this morning, I still couldn't get it to work. All data is in numerical form. Tab 1 has over 60,000 rows of data as does tab 2. The data is not on the same row on either tab. The problem is that on tab 1 there are several rows with the same account #. The element # helps identify the specific acct/element combination with the rate.

Tab 1: Tab 2:
Account # Element # Rate Account # Element # Rate
10435 56407 463065 740846 453.23
65657 89897 575757 945485 135.76

I want to create a formula that says is the account # on tab 1 matches the acct # on tab 2 and the element # on tab 1 matches the element # on tab 2, then give me the rate on tab 2 and populate it in the rate column (that is currently blank) on tab 1. Hope this helps a bit more than my previous explanation.

Thank you!!!!
 
Upvote 0
Tab 1Tab 2
Account #Element #RateAccount #Element # Rate
164543545 69976567645.65
654547212 22177598934.76

<colgroup><col span="7"><col></colgroup><tbody>
</tbody>
 
Upvote 0
The table above and the explanation above that go together. Hopefully someone can make sense of it and help with the formula.
 
Upvote 0
E:EJ:JB:BG:GH:H
Tab 1Tab 2
Account #Element #RateAccount #Element # Rate
16454354569976567645.65
65454721222177598934.76

<tbody>
</tbody>

Except for the ranges, the formula from post 3 looks to be exactly what you want. Just change the ranges to match. I've tried to color code them for you.

=SUMIFS(_20181219_milly_final_2!$H:$H,_20181219_milly_final_2!$B:$B,E3,_20181219_milly_final_2!$G:$G,J3)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

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