Lookup or Match?

jbodel

New Member
Joined
Jun 2, 2014
Messages
47
Office Version
  1. 365
Platform
  1. Windows
I have a sheet (We will call it sheet 1) that lists a company name and a billing account number (for a service we provide). If this business has multiple locations, they list a secondary account in the next column. However some people have been listing the next account in the same column, but with a comma or semi-colin separating them. Now the other sheet (We will call it sheet 2) shows all the accounts we are charging for this specific service. What we are trying to find is accounts we are not charging. I will try to make an example below. I am trying to find a formula that will look at at all the potential columns in sheet one that has an account number and look to see if it is found on Sheet 2. I was hoping this would be something like a Vlookup, but I think it is more complicated than that.

In the example below (second table below) it shows that we are charging one of the accounts for ABC Company (111111111) but not the second account. We are not charging any of the accounts for DEF Company, etc. I need (on sheet 1, to indicate if we are charging or not.

Does this all makes sense? I hope it does, and I hope there is an easy to understand formula....

Thank you in advance.

Sheet
Customer NameBilling ActAdditional Billing ActAdditional Billing Act
ABC Company11111111122222222
DEF Company1234; 55555; 68791233333
LMNOP Company999998888; 77777

On the second sheet it is just a list of account numbers and if we are charging. So if the account is not listed below, we are not charging.

Customer NameAccount NumberCharge
ABC Company1111111Yes
LMNOP Company77777Yes
 
How does this work for you?

MrExcelPlayground24.xlsx
ABCDEFGHI
1
2Customer NameBilling ActAdditional Billing ActAdditional Billing Act2Customer NameAccount NumberCharge
3ABC Company11111111122222222ABC Company111111111Yes
4DEF Company1234; 55555; 68791233333LMNOP Company77777Yes
5LMNOP Company999998888; 77777
6
7
8
9Uncharged Accounts
10ABC Company22222222
11DEF Company12345555568791233333
12LMNOP Company999998888
Sheet10
Cell Formulas
RangeFormula
A10:E12A10=LET(z,Table6[Customer Name],a,TEXTSPLIT(TEXTJOIN("!",TRUE,(BYROW(Table6[[Billing Act]:[Additional Billing Act2]],LAMBDA(r,TEXTJOIN(";",TRUE,r))))),";","!",TRUE,1,""),b,XMATCH(VALUE(a),VALUE(Table7[Account Number]),0),c,IF(ISNA(b),a,""),HSTACK(z,c))
Dynamic array formulas.
 
Upvote 0
I have a sheet (We will call it sheet 1) that lists a company name and a billing account number (for a service we provide). If this business has multiple locations, they list a secondary account in the next column. However some people have been listing the next account in the same column, but with a comma or semi-colin separating them. Now the other sheet (We will call it sheet 2) shows all the accounts we are charging for this specific service. What we are trying to find is accounts we are not charging. I will try to make an example below. I am trying to find a formula that will look at at all the potential columns in sheet one that has an account number and look to see if it is found on Sheet 2. I was hoping this would be something like a Vlookup, but I think it is more complicated than that.
Assumption:
1. Sheet1!A1 = "Customer Name", Sheet2!A1 = "Customer Name"
2. Formula for Sheet2!C2
Code:
=IFERROR(IF(LOOKUP(2;1/(FIND(B2;INDEX(Sheet1!B$2:C$100;MATCH(A2;Sheet1!A$2:A$100;0);))>0))=1;"Yes");"")
[code]
 
Upvote 0

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