I have 2 worksheets "Master Database" & "Group Generation Module"
"Master Database" contains all customer data and "Group Generation Module" is where certain data is going to be imported from "Master Database" like customer name, amount paid, branch, group code etc.
I have created a drop down list in cell A1 with group codes CA,CB,CC,CD and when I select CA from the drop down list in "Group Generation Module". The following formulas are used as described below.
In "Master Database" sheet:
IF(P3="","-",P3&"_"&COUNTIF(P$3:P3,P3)) = to count the No. of group Code appearing in a row, so when the formula is copied down to say 100 rows, it will appear like "IF(P100="","-",P100&"_"&COUNTIF(P$3:P100,P100))" in the 100th row. This will give the count of CA,CB,CC,CD in the respective rows. So, if CA appears 12 times the formula result shows CA_12 in the 12th position of the CA group code row.
In "Group Generation Module" sheet:
IF(ISNA(MATCH($H$1&"_"&ROWS(A$1:A1),'Master Database'!AC:AC,0)),"",MATCH($H$1&"_"&ROWS(A$1:A1),'Master Database'!AC:AC,0)) = to show the row id of the particular match. For eg Group code 'CA' appearing at row P3 in Sheet1 will show as "3". Referring this formula, I used "IF($AJ3="","",INDEX('Master Database'!B:B,$AJ3))" to pull data like customer name, amount paid, branch etc based on this row ID from "Master Database".
Now, the above formulas works like charm but what I want to do is - In "Master Database", next to Group Code is Division column heading. If the Division is allotted to a particular cell, say P3 (group code) is CA and Q3 (division) allotted is 1 then in "Group Generation Module" the row id formula should skip this row and should look for a row for which division is not allotted.
Can anyone help on this...