[TABLE="width: 676"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]disp date[/TD]
[TD]lloyds[/TD]
[TD]homecare[/TD]
[TD]paracetamol[/TD]
[TD]aspirin[/TD]
[TD]omeprazole[/TD]
[TD]iron tabs[/TD]
[TD]sudafed[/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD="align: right"]01-09-17[/TD]
[TD]lloyds[/TD]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD="align: right"]03-09-17[/TD]
[TD][/TD]
[TD]homecare[/TD]
[TD][/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]23[/TD]
[TD][/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD="align: right"]03-09-17[/TD]
[TD][/TD]
[TD]homecare[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD="align: right"]56[/TD]
[TD][/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Patient D[/TD]
[TD="align: right"]10-10-17[/TD]
[TD]lloyds[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Disp Date[/TD]
[TD]Pharmacy[/TD]
[TD]Drug[/TD]
[TD]Quantity[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD]01-09-17[/TD]
[TD]lloyds[/TD]
[TD]paracetamol[/TD]
[TD]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD]01-09-17[/TD]
[TD][/TD]
[TD]paracetamol[/TD]
[TD]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD]homecare[/TD]
[TD]aspirin[/TD]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]omeprazole[/TD]
[TD]23[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]sudafed[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD]homecare[/TD]
[TD]paracetamol[/TD]
[TD]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]omeprazole[/TD]
[TD]56[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]sudafed[/TD]
[TD]30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient D[/TD]
[TD]10-10-17[/TD]
[TD]lloyds[/TD]
[TD]aspirin[/TD]
[TD]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 619"]
<colgroup><col><col><col><col span="2"><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
[TABLE="width: 619"]
<colgroup><col><col><col><col span="2"><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
At the top is a table where each patient has multiple drugs listed with the quantity supplied for each. I need to be able to redisplay each drug as a separate row, also detailing which patient / date and only selecting the pharmacy against their 1st item.
I have found some formulas online, but they do not work if a quantity is repeated in the same row as per patient A.
Any help would be greatly appreciated.
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]disp date[/TD]
[TD]lloyds[/TD]
[TD]homecare[/TD]
[TD]paracetamol[/TD]
[TD]aspirin[/TD]
[TD]omeprazole[/TD]
[TD]iron tabs[/TD]
[TD]sudafed[/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD="align: right"]01-09-17[/TD]
[TD]lloyds[/TD]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD="align: right"]03-09-17[/TD]
[TD][/TD]
[TD]homecare[/TD]
[TD][/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]23[/TD]
[TD][/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD="align: right"]03-09-17[/TD]
[TD][/TD]
[TD]homecare[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD="align: right"]56[/TD]
[TD][/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Patient D[/TD]
[TD="align: right"]10-10-17[/TD]
[TD]lloyds[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Disp Date[/TD]
[TD]Pharmacy[/TD]
[TD]Drug[/TD]
[TD]Quantity[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD]01-09-17[/TD]
[TD]lloyds[/TD]
[TD]paracetamol[/TD]
[TD]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient A[/TD]
[TD]01-09-17[/TD]
[TD][/TD]
[TD]paracetamol[/TD]
[TD]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD]homecare[/TD]
[TD]aspirin[/TD]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]omeprazole[/TD]
[TD]23[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient B[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]sudafed[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD]homecare[/TD]
[TD]paracetamol[/TD]
[TD]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]omeprazole[/TD]
[TD]56[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient C[/TD]
[TD]03-09-17[/TD]
[TD][/TD]
[TD]sudafed[/TD]
[TD]30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Patient D[/TD]
[TD]10-10-17[/TD]
[TD]lloyds[/TD]
[TD]aspirin[/TD]
[TD]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 619"]
<colgroup><col><col><col><col span="2"><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
[TABLE="width: 619"]
<colgroup><col><col><col><col span="2"><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
At the top is a table where each patient has multiple drugs listed with the quantity supplied for each. I need to be able to redisplay each drug as a separate row, also detailing which patient / date and only selecting the pharmacy against their 1st item.
I have found some formulas online, but they do not work if a quantity is repeated in the same row as per patient A.
Any help would be greatly appreciated.