Need help with Formula Please - Nested Vlookup, LEN, SEARCH, etc.

jberman

New Member
Joined
Dec 12, 2016
Messages
10
I am using Excel 2013.

I downloaded a Bank of America Export that shows many transactions that have originated from employees using their Debit Cards. Each Debit card ends in a different set of 4 digits. I am trying to create a formula to FIND these 4 digits (they are usually after a bunch of XXXXs) and take those digits to look up which department the employee is in, and to put that department in the cell.

For Example, the export looks like this:

DELTA AIR 00623828305 DELTA.COM CA 24717057132871320458739 CKCD 3058 XXXXXXXXXXXX4466 XXXX XXXX XXXX 4466

4466 is the last four digits of the Debit Card. As you can see, the last four digits might show up 2x in the cell. This employee belongs to the department "Corporate".

I would like the results of the formula to show me "Corporate" in the cell.

I have a chart that looks something like this which is where the Formula should look for when pulling the Departments. Or if its easier to embed it in the formula, I could do that too.

4524
Bev Hills
4516
Bev Hills
4573
Corp
0421
Corp
8129
Madison
6248
Miami
4540
Wall Street
4482
Wholesale

<tbody>
</tbody>


Please help!! =] THANKS
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You could do something like this:

ABCDE
1DELTA AIR 00623828305 DELTA.COM CA 24717057132871320458739 CKCD 3058 XXXXXXXXXXXX4466 XXXX XXXX XXXX 4466CorpLast 4Department
24524Bev Hills
34516Bev Hills
44573Corp
5421Corp
68129Madison
76248Miami
84540Wall Street
94482Wholesale
104466Corp

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
B1=LOOKUP(2,1/FIND(D2:D10,A1),E2:E10)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



However, you would have to worry about false matches if the number is found somewhere else in the cell. Also, column D should be defined as Text so that you get the 0 in front of 421. You can make the list longer, but unused entries at the end should have something in them that will never match (QQQQQQQQ) to prevent false matches.
 
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,904
Members
449,477
Latest member
panjongshing

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