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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
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
[TABLE="width: 666"]
<colgroup><col span="7"><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Tab 1[/TD]
[TD][/TD]
[TD="colspan: 3"]Tab 2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Account #[/TD]
[TD]Element #[/TD]
[TD]Rate[/TD]
[TD][/TD]
[TD]Account #[/TD]
[TD]Element #[/TD]
[TD] Rate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]164543[/TD]
[TD]545[/TD]
[TD] [/TD]
[TD][/TD]
[TD]699765[/TD]
[TD]676[/TD]
[TD]45.65[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]654547[/TD]
[TD]212[/TD]
[TD] [/TD]
[TD][/TD]
[TD]221775[/TD]
[TD]989[/TD]
[TD]34.76[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
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
[TABLE="width: 666"]
<tbody>[TR]
[TD]E:E[/TD]
[TD]J:J[/TD]
[TD][/TD]
[TD][/TD]
[TD]B:B[/TD]
[TD]G:G[/TD]
[TD]H:H[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Tab 1[/TD]
[TD][/TD]
[TD="colspan: 3"]Tab 2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Account #[/TD]
[TD]Element #[/TD]
[TD]Rate[/TD]
[TD][/TD]
[TD]Account #[/TD]
[TD]Element #[/TD]
[TD] Rate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]164543[/TD]
[TD]545[/TD]
[TD][/TD]
[TD][/TD]
[TD]699765[/TD]
[TD]676[/TD]
[TD]45.65[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]654547[/TD]
[TD]212[/TD]
[TD][/TD]
[TD][/TD]
[TD]221775[/TD]
[TD]989[/TD]
[TD]34.76[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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