Data Validation List without duplicates

dsubash

New Member
Joined
Nov 22, 2024
Messages
32
Office Version
  1. 2019
  2. Prefer Not To Say
Platform
  1. Windows
Dear experts,

I have a database in Sheet 1, which contains the following fields
Col. A - List of Branches (Contains Duplicate Entries)
Col. B - List of Products (Contains Duplicate Entries) - certain products are unique to only certain branches while few products are available in all branches.
Col. C - Col. M - other details.

This sheet contains more than 10000 records containing the transactions for a particular month.

I need to prepare a report in Sheet 2 with the Branch and Product as criterias.
In Cell. A2, I have created a dropdown list for branches (after removing duplicates) and used Name Manager to create a Data Validation List.
I need the following in Cell B2 (Sheet 2)
a. A dropdown list of products from Col. B of Sheet 1
b. I need only the products list available against the branch selected in Cell A1 and should not display the products that are not available in the specific branch.
c. Duplicate product names to be removed and only unique names to be available in the dropdown list.
d. Option for autofill product names when one or more characters are typed.
e. Dropdown list should not contain blank entries
f. If possible Product names to be alphabetically displayed.

I tried to use Vlookup and for listing products against each branch in different columns, tried removing duplicates from this list in another column and using name manager for each branch. But since my list of branches and Products are more (20 + branches and 500 + products), I found it difficult to create multiple columns for vlookup and removing duplicates. Also had the problem of blanks in the drop down.

Is there any other options (VBA Code) to get what i want. I am using Office 2019 Professional and hence cannot use formulas avaialble in later versions (Sort / Unique, etc).

I tried viewing many threads in the forum, but was unable to find what i want. Threads available were mostly for higher versions of excel.

Thanks and regards
Subash D
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Dear Moorthy,

I applied your formulas and codes for a different file. Everything works fine expect one aspect.

In Sheet 2 (Requirements), When I change Column B8 - B200, I need only the list of Items corresponding to the Instrument name in Column B to the available in the dropdown box in Column C. Right now, this works fine only for Cell B8, but from B9 onwards, it is not working properly.

I have attached the sample file for your reference. Please let me know where am i going wrong.

Sheet 1 (Master Sheet)

Instruments & Reagents - Sample.xlsm
ABCDEFGHI
1Instrument / DepartmentItem NameTypeUOMPriceInstrument / DepartmentItem Name
2RTPCR0.1ml 96 well PCR PlateGlasswareNosRTPCRCoralyser Cuvettes
3RTPCR0.2ml 96 well PCR Plate-25'sGlasswareBox1Coralyzer Surfactant-2X75ml
4RTPCR0.2ml PCR 8 StripGlasswareBoxAutobioCoral Glucose-3X150ml
518 Strip CapsGlasswarePktBiomedical WasteCoralyser 200 Glucose-80ml
61Acetic Acid Glacial-500mlChemicalNosQCCoralyser 200 Magnesium-2X40ml
71Acid Fast Stain KitChemicalBox278House KeepingCoralyzer 200 Albumin Kit-80ml
8AutobioAutobio-Cuvette 1000'sGlasswarePkt2360CoralyserCoralyzer 200 Alkaline Phosphatase-40ml
91AVE-Buffer 40mlChemicalNos11800ZybioCoralyzer 200 Calcium Kit-40ml
101AVE-Cleanser I-500mlChemicalNos14160MicrobiologyCoralyzer 200 CK MB-40ml
111AVE-Cleanser II-40mlChemicalNos11800CentrifugeCoralyzer 200 CK NAC-40ml
121Barium Chloride 10% 500mlChemicalNosMispaCoralyzer 200 Creatinine-60ml
131Benzidine Powder-25gmChemicalNosSample CollectionCoralyzer 200 Gamma GT-40ml
14Biomedical WasteBiomedical Waste Cover Blue-MediumHouse KeepingNos15TruenatCoralyzer 200 HDL-D Cholestrol-40ml
15Biomedical WasteBiomedical Waste Cover Green-SmallHouse KeepingNos15PrintingCoralyzer 200 LDH-40ml
16Biomedical WasteBiomedical Waste Cover Red-MediumHouse KeepingNos15RadiologyCoralyzer 200 LDL-D Cholestrol-40ml
17Biomedical WasteBiomedical Waste Cover Yellow-MediumHouse KeepingNos15FinecareCoralyzer 200 Lipase-25ml
18QCBio-Rad QC Level 1-5mlChemicalNos840ElisaCoralyzer 200 Phosphorus(UV)-40ml
19QCBio-Rad QC Level 2-5mlChemicalNos840LifotronicsCoralyzer 200 SGOT Kit-80ml
201Blood Culture Broth-20mlChemicalNos146StationeryCoralyzer 200 SGPT-80ml
211Blood Culture Broth-70mlChemicalNos152SurgicalCoralyzer 200 Total Protein-80ml
221BT Cleaning SolutionChemicalNos7000 Coralyzer 200 Triglyceride-80ml
231BT Washing SolutionChemicalNos3500 Coralyzer 200 Urea Kit-80ml
24House KeepingBudsHouse KeepingPkt10 Coralyzer 200 Uric Acid-40ml
251Calcium Chloride-10mlChemicalNos208 coralyzer 200-Amylase Kit-40ml
261Cartridge BG10-25TChemicalNos13216 Coralyzer 200-Cholestrol Kit-80ml
271Cedarwood Oil-25mlChemicalNos520 Coralyzer 200-Direct Bilirubin-80ml
281Chloride-25TChemicalBox410 Coralyzer 200-Iron Kit 75ml
29CoralyserCoralyser CuvettesGlasswareNos85 Coralyzer 200-Total Bilirubin-80ml
30CoralyserCoralyzer Surfactant-2X75mlChemicalNos2493 Coralyzer Cleaning Solution-250ml
311Cover SlipGlasswareNos95  
32House KeepingDeionized Water-20LtrHouse KeepingCan250  
Master
Cell Formulas
RangeFormula
H2:H32H2=IFERROR(INDEX($A$2:$A$500,AGGREGATE(15,6,ROW($A$2:$A$500)/(ISERROR(MATCH($A$2:$A$500,$H$1:$H1,0))),1)-ROW($A$1)),"")
I2:I32I2=IFERROR(INDEX($B$2:$B$500,AGGREGATE(15,6,ROW($B$2:$B$500)/(ISERROR(MATCH($B$2:$B$500,$I$1:$I1,0))*($A$2:$A$500=Requirements!$B$8)),1)-ROW($B$1)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
_FilterDatabase=Master!$A$1:$D$498H2:H32


Sheet 2 (Requirements Sheet)

Instruments & Reagents - Sample.xlsm
ABCDEFGHIJKLMN
1
2
3Branch
4Requirements for the Month of
5
6Sl. No.Requirements (Select from the dropdown list)TypeUOMStock in HandWeekly RequirementsTotal CostRemarks
7Instrument / DepartmentItem NameUnopenedIn Use1st Week2nd Week3rd Week4th WeekTot. Qty.
81CoralyserZybio-ALTReagentNos1232940
92TruenatCoralyser CuvettesGlasswareNos  
103House KeepingCoralyser CuvettesGlasswareNos  
114AutobioCoralyser CuvettesGlasswareNos  
125House KeepingCoralyser CuvettesGlasswareNos  
13     
14     
Requirements
Cell Formulas
RangeFormula
D8:D14D8=IF(C8="","",VLOOKUP(C8,Master!$B$2:$E$451,2,0))
E8:E14E8=IF(C8="","",VLOOKUP(C8,Master!$B$2:$E$451,3,0))
L8:L14L8=IF(C8="","",SUM(H8:K8))
M8:M14M8=IF(C8="","",VLOOKUP(C8,Master!$B$2:$E$500,4,0)*L8)
A8A8=IF(LEN(B8)>0,SUM(A7)+1,"")
A9:A14A9=IF(LEN(C9)>0,SUM(A8)+1,"")
Cells with Data Validation
CellAllowCriteria
B8:B23List=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$404,"?*"))
C8List=OFFSET(Master!$I$2,0,0,COUNTIF(Master!$I$2:$I$500,"?*"))
C9:C13List=OFFSET(Master!$I$2,0,0,COUNTIF(Master!$I$2:$I500,"?*"))
C14:C413List=OFFSET(Master!$I$2,0,0,COUNTIF(Master!$I$2:$I$500,"?*"))


Thanks & Regards
Subash D
 
Upvote 0
Since you are having problem of slow here is the revised solution for Post#1.
Validation list.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1BranchProductTypeUOMDateInv. No.PriceUnique BranchesSydneyIrelandJapanTokyoDelhiOhioNew JerseyBangkokBangalore  
2Sydney0.1ml 96 well PCR PlateGlasswareNos01-12-202455970Sydney0.1ml 96 well PCR Plate0.2ml 96 well PCR Plate-25's0.2ml PCR 8 Strip8 Strip CapsAcid Fast Stain KitAutobio-Cuvette 1000'sAVE-Buffer 40mlAVE-Cleanser I-500mlAVE-Cleanser II-40ml  
3Ireland0.2ml 96 well PCR Plate-25'sGlasswareBox02-12-202456013Ireland   Biomedical Waste Cover Green-SmallBiomedical Waste Cover Red-MediumBiomedical Waste Cover Yellow-MediumBarium Chloride 10% 500mlBenzidine Powder-25gmBiomedical Waste Cover Blue-Medium  
4Japan0.2ml PCR 8 StripGlasswareBox02-12-202456014Japan      Bio-Rad QC Level 1-5mlBio-Rad QC Level 2-5ml   
5Tokyo8 Strip CapsGlasswarePkt02-12-202456018Tokyo           
6DelhiAcid Fast Stain KitChemicalBox02-12-202456020Delhi           
7OhioAutobio-Cuvette 1000'sReagentNos02-12-202456021Ohio           
8New JerseyAVE-Buffer 40mlReagentBox02-12-202456022New Jersey           
9BangkokAVE-Cleanser I-500mlReagentBox02-12-202456023Bangkok           
10BangaloreAVE-Cleanser II-40mlReagentBox02-12-202456024Bangalore           
11New JerseyBarium Chloride 10% 500mlReagentBox02-12-202456026            
12BangkokBenzidine Powder-25gmReagentNos02-12-202456027            
13BangaloreBiomedical Waste Cover Blue-MediumReagentNos02-12-202456029            
14TokyoBiomedical Waste Cover Green-SmallReagentNos02-12-202456036            
15DelhiBiomedical Waste Cover Red-MediumReagentNos02-12-202456037            
16OhioBiomedical Waste Cover Yellow-MediumReagentNos02-12-202456039            
17New JerseyBio-Rad QC Level 1-5mlReagentNos02-12-202456040            
18BangkokBio-Rad QC Level 2-5mlReagentNos02-12-202456046            
Sheet 1
Cell Formulas
RangeFormula
L1:V1L1=INDEX($K$2:$K$48,COLUMNS($L$1:L$1))
K2:K18K2=IFERROR(INDEX($A$2:$A$44,AGGREGATE(15,6,ROW($A$2:$A$44)/(($A$2:$A$44<>"")*ISERROR(MATCH($A$2:$A$44,$K$1:$K1,0))),1)-ROW($A$1)),"")
L2:V18L2=IF(L$1="","",IFERROR(INDEX($B$2:$B$215,AGGREGATE(15,6,ROW($B$2:$B$215)/(ISERROR(MATCH($B$2:$B$215,$L$1:$L1,0))*($A$2:$A$215=L$1)),ROWS(L$2:L2))-ROW($B$1)),""))

Validation list.xlsm
ABCDEFG
1
2BangaloreAVE-Cleanser II-40ml
3
4
5
6Sl. NoTypeUOMDateInv. No.Price
71ReagentBox45628560240
8      
9      
Sheet 2
Cell Formulas
RangeFormula
A7:A9A7=IF(LEN(B7)>0,SUM(A6)+1,"")
B7:F9B7=IFERROR(INDEX('Sheet 1'!C$2:C$44,AGGREGATE(15,6,ROW('Sheet 1'!$C$2:$C$44)/(ISNUMBER(MATCH('Sheet 1'!$A$2:$A$44,'Sheet 2'!$A$2,0))*ISNUMBER(MATCH('Sheet 1'!$B$2:$B$44,'Sheet 2'!$B$2,0))),ROWS($C$7:$C7))-ROW($C$1)),"")
Cells with Data Validation
CellAllowCriteria
A2List=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$100,"?*"))
B2List=OFFSET('Sheet 1'!$K$2,0,MATCH($A2,'Sheet 1'!$L$1:$AJ$1,0),COUNTIF(INDEX('Sheet 1'!$L$2:$AJ$48,,MATCH($A2,'Sheet 1'!$L$1:$AJ$1,0)),"*?"))
 
Upvote 0
Ref Post#12
Validation list.xlsm
GHIJKLMNOPQRST
1Instrument / DepartmentRTPCR1AutobioBiomedical WasteQCHouse KeepingCoralyserBangkokBangaloreTokyoSydneyIreland
2RTPCR0.1ml 96 well PCR Plate8 Strip CapsAutobio-Cuvette 1000'sBiomedical Waste Cover Blue-MediumBio-Rad QC Level 1-5mlBudsCoralyser CuvettesDiluent-20Ltr (Zybio Z3)Diluent-20Ltr (Zybio Z5)Amikacin 30mcg-100's (AK30)Amoxicillin/Clavulanate 20/10mcg 100's (AMC20/10)Azithromycin 15mcg 100's (AZM15)
310.2ml PCR 8 StripAcetic Acid Glacial-500ml Biomedical Waste Cover Green-SmallBio-Rad QC Level 2-5mlDeionized Water-20LtrCoralyzer Surfactant-2X75mlCefixime 5mcg 100'sCefotoxime 30mcg 100's (CTX30)Bacitracin-100's  
4Autobio Acid Fast Stain Kit Biomedical Waste Cover Red-Medium        
5Biomedical Waste AVE-Buffer 40ml Biomedical Waste Cover Yellow-Medium        
6QC AVE-Cleanser I-500ml          
7House Keeping AVE-Cleanser II-40ml          
8Coralyser Barium Chloride 10% 500ml          
9Bangkok Benzidine Powder-25gm          
10Bangalore Blood Culture Broth-20ml          
11Tokyo Blood Culture Broth-70ml          
12Sydney BT Cleaning Solution          
13Ireland BT Washing Solution          
14Japan Calcium Chloride-10ml          
15Delhi Cartridge BG10-25T          
16Ohio Cedarwood Oil-25ml          
17New Jersey Chloride-25T          
18  Cover Slip          
19             
20             
21             
Master
Cell Formulas
RangeFormula
I1:T1I1=INDEX($H$2:$H$48,COLUMNS($I$1:I$1))
H2:H21H2=IFERROR(INDEX($A$2:$A$44,AGGREGATE(15,6,ROW($A$2:$A$44)/(ISERROR(MATCH($A$2:$A$44,$H$1:$H1,0))),1)-ROW($A$1)),"")
I2:T21I2=IF(I$1="","",IFERROR(INDEX($B$2:$B$44,AGGREGATE(15,6,ROW($B$2:$B$44)/(ISERROR(MATCH($B$2:$B$44,$I$1:$I1,0))*($A$2:$A$44=I$1)),ROWS(I$2:I2))-ROW($B$1)),""))

Validation list.xlsm
ABCDEFGHIJKLMN
1
2RTPCR
3Branch
4Requirements for the Month of
5
6Sl. No.Requirements (Select from the dropdown list)TypeUOMStock in HandWeekly RequirementsTotal CostRemarks
7Instrument / DepartmentItem NameUnopenedIn Use1st Week2nd Week3rd Week4th WeekTot. Qty.
8 
91AutobioAutobio-Cuvette 1000's
10 
111House KeepingDeionized Water-20Ltr
12 
131Biomedical WasteBiomedical Waste Cover Red-Medium
14 
Requirements
Cell Formulas
RangeFormula
C2C2=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$100,"?*"))
A8:A14A8=IF(LEN(B8)>0,SUM(A7)+1,"")
Cells with Data Validation
CellAllowCriteria
B8:B20List=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$48,"*?")+1)
C8:C20List=OFFSET(Master!$H$2,0,MATCH($B8,Master!$I$1:$AJ$1,0),COUNTIF(INDEX(Master!$I$2:$AJ$48,,MATCH($B8,Master!$I$1:$AJ$1,0)),"*?"))

In Master sheet Formula in T1 may be extended further.
 
Upvote 0
Ref Post#12
Validation list.xlsm
GHIJKLMNOPQRST
1Instrument / DepartmentRTPCR1AutobioBiomedical WasteQCHouse KeepingCoralyserBangkokBangaloreTokyoSydneyIreland
2RTPCR0.1ml 96 well PCR Plate8 Strip CapsAutobio-Cuvette 1000'sBiomedical Waste Cover Blue-MediumBio-Rad QC Level 1-5mlBudsCoralyser CuvettesDiluent-20Ltr (Zybio Z3)Diluent-20Ltr (Zybio Z5)Amikacin 30mcg-100's (AK30)Amoxicillin/Clavulanate 20/10mcg 100's (AMC20/10)Azithromycin 15mcg 100's (AZM15)
310.2ml PCR 8 StripAcetic Acid Glacial-500ml Biomedical Waste Cover Green-SmallBio-Rad QC Level 2-5mlDeionized Water-20LtrCoralyzer Surfactant-2X75mlCefixime 5mcg 100'sCefotoxime 30mcg 100's (CTX30)Bacitracin-100's  
4Autobio Acid Fast Stain Kit Biomedical Waste Cover Red-Medium        
5Biomedical Waste AVE-Buffer 40ml Biomedical Waste Cover Yellow-Medium        
6QC AVE-Cleanser I-500ml          
7House Keeping AVE-Cleanser II-40ml          
8Coralyser Barium Chloride 10% 500ml          
9Bangkok Benzidine Powder-25gm          
10Bangalore Blood Culture Broth-20ml          
11Tokyo Blood Culture Broth-70ml          
12Sydney BT Cleaning Solution          
13Ireland BT Washing Solution          
14Japan Calcium Chloride-10ml          
15Delhi Cartridge BG10-25T          
16Ohio Cedarwood Oil-25ml          
17New Jersey Chloride-25T          
18  Cover Slip          
19             
20             
21             
Master
Cell Formulas
RangeFormula
I1:T1I1=INDEX($H$2:$H$48,COLUMNS($I$1:I$1))
H2:H21H2=IFERROR(INDEX($A$2:$A$44,AGGREGATE(15,6,ROW($A$2:$A$44)/(ISERROR(MATCH($A$2:$A$44,$H$1:$H1,0))),1)-ROW($A$1)),"")
I2:T21I2=IF(I$1="","",IFERROR(INDEX($B$2:$B$44,AGGREGATE(15,6,ROW($B$2:$B$44)/(ISERROR(MATCH($B$2:$B$44,$I$1:$I1,0))*($A$2:$A$44=I$1)),ROWS(I$2:I2))-ROW($B$1)),""))

Validation list.xlsm
ABCDEFGHIJKLMN
1
2RTPCR
3Branch
4Requirements for the Month of
5
6Sl. No.Requirements (Select from the dropdown list)TypeUOMStock in HandWeekly RequirementsTotal CostRemarks
7Instrument / DepartmentItem NameUnopenedIn Use1st Week2nd Week3rd Week4th WeekTot. Qty.
8 
91AutobioAutobio-Cuvette 1000's
10 
111House KeepingDeionized Water-20Ltr
12 
131Biomedical WasteBiomedical Waste Cover Red-Medium
14 
Requirements
Cell Formulas
RangeFormula
C2C2=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$100,"?*"))
A8:A14A8=IF(LEN(B8)>0,SUM(A7)+1,"")
Cells with Data Validation
CellAllowCriteria
B8:B20List=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$48,"*?")+1)
C8:C20List=OFFSET(Master!$H$2,0,MATCH($B8,Master!$I$1:$AJ$1,0),COUNTIF(INDEX(Master!$I$2:$AJ$48,,MATCH($B8,Master!$I$1:$AJ$1,0)),"*?"))

In Master sheet Formula in T1 may be extended further.

Thanks a lot Mr. Murthy.

It works fine and have circulated to all my branches.

I need a small addition: Is it possible to categorize the dropdown items in alphbetical order and I would also like to know if there can be an option of auto suggestion wherein the list narrows down based on the characters typed in the dropdown box instead of scrolling up and down for the required item.

Thanks and Regards
Subash D
 
Upvote 0
Since you are having problem of slow here is the revised solution for Post#1.
Validation list.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1BranchProductTypeUOMDateInv. No.PriceUnique BranchesSydneyIrelandJapanTokyoDelhiOhioNew JerseyBangkokBangalore  
2Sydney0.1ml 96 well PCR PlateGlasswareNos01-12-202455970Sydney0.1ml 96 well PCR Plate0.2ml 96 well PCR Plate-25's0.2ml PCR 8 Strip8 Strip CapsAcid Fast Stain KitAutobio-Cuvette 1000'sAVE-Buffer 40mlAVE-Cleanser I-500mlAVE-Cleanser II-40ml  
3Ireland0.2ml 96 well PCR Plate-25'sGlasswareBox02-12-202456013Ireland   Biomedical Waste Cover Green-SmallBiomedical Waste Cover Red-MediumBiomedical Waste Cover Yellow-MediumBarium Chloride 10% 500mlBenzidine Powder-25gmBiomedical Waste Cover Blue-Medium  
4Japan0.2ml PCR 8 StripGlasswareBox02-12-202456014Japan      Bio-Rad QC Level 1-5mlBio-Rad QC Level 2-5ml   
5Tokyo8 Strip CapsGlasswarePkt02-12-202456018Tokyo           
6DelhiAcid Fast Stain KitChemicalBox02-12-202456020Delhi           
7OhioAutobio-Cuvette 1000'sReagentNos02-12-202456021Ohio           
8New JerseyAVE-Buffer 40mlReagentBox02-12-202456022New Jersey           
9BangkokAVE-Cleanser I-500mlReagentBox02-12-202456023Bangkok           
10BangaloreAVE-Cleanser II-40mlReagentBox02-12-202456024Bangalore           
11New JerseyBarium Chloride 10% 500mlReagentBox02-12-202456026            
12BangkokBenzidine Powder-25gmReagentNos02-12-202456027            
13BangaloreBiomedical Waste Cover Blue-MediumReagentNos02-12-202456029            
14TokyoBiomedical Waste Cover Green-SmallReagentNos02-12-202456036            
15DelhiBiomedical Waste Cover Red-MediumReagentNos02-12-202456037            
16OhioBiomedical Waste Cover Yellow-MediumReagentNos02-12-202456039            
17New JerseyBio-Rad QC Level 1-5mlReagentNos02-12-202456040            
18BangkokBio-Rad QC Level 2-5mlReagentNos02-12-202456046            
Sheet 1
Cell Formulas
RangeFormula
L1:V1L1=INDEX($K$2:$K$48,COLUMNS($L$1:L$1))
K2:K18K2=IFERROR(INDEX($A$2:$A$44,AGGREGATE(15,6,ROW($A$2:$A$44)/(($A$2:$A$44<>"")*ISERROR(MATCH($A$2:$A$44,$K$1:$K1,0))),1)-ROW($A$1)),"")
L2:V18L2=IF(L$1="","",IFERROR(INDEX($B$2:$B$215,AGGREGATE(15,6,ROW($B$2:$B$215)/(ISERROR(MATCH($B$2:$B$215,$L$1:$L1,0))*($A$2:$A$215=L$1)),ROWS(L$2:L2))-ROW($B$1)),""))

Validation list.xlsm
ABCDEFG
1
2BangaloreAVE-Cleanser II-40ml
3
4
5
6Sl. NoTypeUOMDateInv. No.Price
71ReagentBox45628560240
8      
9      
Sheet 2
Cell Formulas
RangeFormula
A7:A9A7=IF(LEN(B7)>0,SUM(A6)+1,"")
B7:F9B7=IFERROR(INDEX('Sheet 1'!C$2:C$44,AGGREGATE(15,6,ROW('Sheet 1'!$C$2:$C$44)/(ISNUMBER(MATCH('Sheet 1'!$A$2:$A$44,'Sheet 2'!$A$2,0))*ISNUMBER(MATCH('Sheet 1'!$B$2:$B$44,'Sheet 2'!$B$2,0))),ROWS($C$7:$C7))-ROW($C$1)),"")
Cells with Data Validation
CellAllowCriteria
A2List=OFFSET(Master!$H$2,0,0,COUNTIF(Master!$H$2:$H$100,"?*"))
B2List=OFFSET('Sheet 1'!$K$2,0,MATCH($A2,'Sheet 1'!$L$1:$AJ$1,0),COUNTIF(INDEX('Sheet 1'!$L$2:$AJ$48,,MATCH($A2,'Sheet 1'!$L$1:$AJ$1,0)),"*?"))

Sir,

This one too much time even to copy formulas. It says "Calculating (12 Threads): 0%". I am not able to close this file nor open any other excel file when this specific file is open. Is it because of the range (20000 records). I am not able to complete copying the formulas in Sheet 1 itself. I have kept the file open for nearly 2 hours and had to close the file using task manager to work on other files.

Regards
Subash D
 
Upvote 0
If Possible upload the file with only required Columns and erasing all other data in some website and give link here.. I will check.
 
Upvote 0
If Possible upload the file with only required Columns and erasing all other data in some website and give link here.. I will check.
Sir,

Have uploaded the actual template with all data's removed and retaining only the column headers in dropbox.

The link to download is

Thanks
Subash D
 
Upvote 0
Your file does not contain any data. I have asked you to keep the required data.
Anyway with reference to data in Post#1 Here is the VBA code for macro "GetBranchProductsList".
Remove all formulas From column K and on words in Sheet 1. Run the Macro to get list in Sheet 1.
For DV use formulas below for sheet 2.
For A2
Excel Formula:
=OFFSET('Sheet 1'!$K$2,0,0,COUNTA('Sheet 1'!$K$2:$K$1000))
For B2
Excel Formula:
=OFFSET('Sheet 1'!$K$2,0,MATCH($A2,'Sheet 1'!$L$1:$DZ$1,0),COUNTA(INDEX('Sheet 1'!$L$2:$DZ$1000,,MATCH($A2,'Sheet 1'!$L$1:$DZ$1,0))))
Max Rows I have taken is 1000. if required Change it.
VBA code;
VBA Code:
Sub GetBranchProductsList()
Dim A, M, T&, Ta&, K&
Dim Dic1 As Object
Application.ScreenUpdating = False
A = Sheets("Sheet 1").Range("A1").CurrentRegion.Offset(1, 0).Resize(, 2)
Set Dic1 = CreateObject("Scripting.dictionary")
With Dic1
For T = 1 To UBound(A, 1) - 1
If .exists(A(T, 1)) Then
.Item(A(T, 1)) = .Item(A(T, 1)) & "," & A(T, 2)
Else
.Item(A(T, 1)) = A(T, 2)
End If
Next T
K = .Count
End With

With Sheets("Sheet 1").Range("K1")
.CurrentRegion.Clear
.Value = "Branches"
.Offset(1, 0).Resize(K, 1) = WorksheetFunction.Transpose(Dic1.keys)
.Offset(0, 1).Resize(1, K) = Dic1.keys
For Ta = 0 To K - 1
M = Split(Dic1.Item(A(Ta + 1, 1)), ",")
If UBound(M) >= 0 Then .Offset(1, Ta + 1).Resize(UBound(M) + 1, 1) = WorksheetFunction.Transpose(M)
M = ""
Next Ta
End With

Application.ScreenUpdating = True
End Sub
 
Upvote 0
Your file does not contain any data. I have asked you to keep the required data.
Anyway with reference to data in Post#1 Here is the VBA code for macro "GetBranchProductsList".
Remove all formulas From column K and on words in Sheet 1. Run the Macro to get list in Sheet 1.
For DV use formulas below for sheet 2.
For A2
Excel Formula:
=OFFSET('Sheet 1'!$K$2,0,0,COUNTA('Sheet 1'!$K$2:$K$1000))
For B2
Excel Formula:
=OFFSET('Sheet 1'!$K$2,0,MATCH($A2,'Sheet 1'!$L$1:$DZ$1,0),COUNTA(INDEX('Sheet 1'!$L$2:$DZ$1000,,MATCH($A2,'Sheet 1'!$L$1:$DZ$1,0))))
Max Rows I have taken is 1000. if required Change it.
VBA code;
VBA Code:
Sub GetBranchProductsList()
Dim A, M, T&, Ta&, K&
Dim Dic1 As Object
Application.ScreenUpdating = False
A = Sheets("Sheet 1").Range("A1").CurrentRegion.Offset(1, 0).Resize(, 2)
Set Dic1 = CreateObject("Scripting.dictionary")
With Dic1
For T = 1 To UBound(A, 1) - 1
If .exists(A(T, 1)) Then
.Item(A(T, 1)) = .Item(A(T, 1)) & "," & A(T, 2)
Else
.Item(A(T, 1)) = A(T, 2)
End If
Next T
K = .Count
End With

With Sheets("Sheet 1").Range("K1")
.CurrentRegion.Clear
.Value = "Branches"
.Offset(1, 0).Resize(K, 1) = WorksheetFunction.Transpose(Dic1.keys)
.Offset(0, 1).Resize(1, K) = Dic1.keys
For Ta = 0 To K - 1
M = Split(Dic1.Item(A(Ta + 1, 1)), ",")
If UBound(M) >= 0 Then .Offset(1, Ta + 1).Resize(UBound(M) + 1, 1) = WorksheetFunction.Transpose(M)
M = ""
Next Ta
End With

Application.ScreenUpdating = True
End Sub

sIR,

Applied your code, but the names are split into different rows and hence, the DV in the next page doesn't work properly. given below is the screenshot of the same.

Referrer Due Statement - Jan 2025.xlsm.xlsm
OP
1BranchesTindivanam
2TindivanamJIPMER HOSPITALS
3Self
4Self
5RAMACHANDRA HOSPITAL
6ARCHANA HOSPITAL
7DR.R.PALANIRAMAN
8MBBS.
9DCH.
10MRCPCH(UK).
11
12Self
13DR.R.PALANIRAMAN
14MBBS.
15DCH.
16MRCPCH(UK).
17
18MUTHU CLINICAL LABORATORY
19DR.R.PALANIRAMAN
20MBBS.
21DCH.
22MRCPCH(UK).
23
24J.FRANKLIN SELVARAJ. MBBS.
25 C.DIAB.
26
27DINESH JOTHIMANI
28DINESH JOTHIMANI
Sheet1


Also, duplicate names are found.
 
Upvote 0

Forum statistics

Threads
1,225,969
Messages
6,188,109
Members
453,460
Latest member
Cjohnson3

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