excel formula if and vlookup together

tonyjyoo

Board Regular
Joined
Aug 5, 2016
Messages
167
Hello,

Need some help with combining an IF statement with VLOOKUP.

The following is an example table:

Company IDCompany NameTransaction TypeDepositsWithdrawals
912B009MUTUAL FUNDS DEBITS1010-9900
018 DTCC PAYMENT AXIS54,843.800
911A009MUTUAL FUNDS DEBITS1000
018 DTCC PAYMENT AXIS4000
930D009MUTUAL FUNDS DEBITS5000-10
018 DTCC PAYMENT AXIS500-100
920C009MUTUAL FUNDS DEBITS99990
018 DTCC PAYMENT AXIS99-999

<tbody>
</tbody>

On a separate excel file, how can I write a formula so that IF column A (company ID) = one of them, THEN VLOOKUP "009MUTUAL FUNDS DEBITS" correspondingly?

So for example, if I wanted a formula for Company B (ID 912), I would want the formula something like =IF(A:A="912", VLOOKUP("009MUTUAL FUNDS DEBITS) so that it will give me 1010.
****** id="cke_pastebin" style="position: absolute; top: 260px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">On
018 DTCC PAYMENT AXIS

<tbody>
</tbody>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try this and let me know if it works:

Code:
=IF(MATCH(912,[Book1]Sheet1!$A:$A,0)>0,VLOOKUP(912,[Book1]Sheet1!$A:$E,4))
Change Book1 and Sheet1 to match your file name and sheet.

Edit: This will yield you #N/A results if it's NOT found since the Match won't return a number but rather an #N/A.
To get rid of this is beyond me, it would have to be a completely different formula (I would just filter out all #N/As at the end and remove them.)
 
Last edited:
Upvote 0
Try this and let me know if it works:

Code:
=IF(MATCH(912,[Book1]Sheet1!$A:$A,0)>0,VLOOKUP(912,[Book1]Sheet1!$A:$E,4))
Change Book1 and Sheet1 to match your file name and sheet.

Edit: This will yield you #N/A results if it's NOT found since the Match won't return a number but rather an #N/A.
To get rid of this is beyond me, it would have to be a completely different formula (I would just filter out all #N/As at the end and remove them.)

This works but how can I incorporate it to sum up everything it finds? SOmetimes, there are several deposits. Would this be a sumif?
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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