# Creating a formula to check if combination of codes is available

#### johanexcel

##### New Member
Dear all,

I would like to request some help with creating a formula.

I have 1 data sheet with account numbers (column A) and departments (Column B). Not all account numbers are available with all departments.

 Account Department 4000 15 4000 16 4000 21 4001 15 4001 17 4001 20

<tbody>
</tbody>

In the input sheet (which will be completed manually) I would like to have a control to see if the combination of account number and department is a valid combination. What formula could I use?

Johan

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

#### Oeldere

##### Well-known Member

Book1
ABCDEFG
1Lookup tableINPUT DATA
2AccountDepartmentAccountDepartment
34000154000154000421data not valid
4400016400016400016
5400021400021400021
6400115400115400115
7400117400117400117
8400120400120400120
Cell Formulas
RangeFormula
C3=A3&B3
C4=A4&B4
C5=A5&B5
C6=A6&B6
C7=A7&B7
C8=A8&B8
G3=IFERROR(IF(MATCH(E3&F3,C3:C8,0)>0,"",),"data not valid")
G4=IFERROR(IF(MATCH(E4&F4,C4:C9,0)>0,"",),"data not valid")
G5=IFERROR(IF(MATCH(E5&F5,C5:C10,0)>0,"",),"data not valid")
G6=IFERROR(IF(MATCH(E6&F6,C6:C11,0)>0,"",),"data not valid")
G7=IFERROR(IF(MATCH(E7&F7,C7:C12,0)>0,"",),"data not valid")
G8=IFERROR(IF(MATCH(E8&F8,C8:C13,0)>0,"",),"data not valid")

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,651
Messages
5,854,956
Members
431,689
Latest member
jacker01

### 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.

### Which adblocker are you using?

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

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