Return Multiple Result Two Dimensions

zaki1979

New Member
Joined
Jun 7, 2022
Messages
20
Office Version
  1. 2019
Platform
  1. Windows
Dear Expert,

I am working in a small project. I have attached my simple data (Input & output)

Master Data Sheet looks like as follows:

Employee ID Client Name Site Name 01/02 02/02 03/02 04/02 05/02 06/02 07/02 08/02
201101 Client A Site X P P A
201101 Client B Site Y P P P
201101 Client C Site Z P A and till the end of the Month of February 2022 (Where P represents Present & A represents Absent)

I have another Sheets (Output Sheet)/Report which will display only unique employee Id I want the result to be displayed as follows:

Employee ID 01/02 02/02 03/02 04/02 05/02 06/02 07/02 08/02 .................................28/02
201101 P P A P P P P A.
201102
201103
etc...

I know that I have to use Index/Match but unfortunately I couldn't solve the task. Is there a way to use Index/Match with Offset
any solution will be highly appreciated.

Many thanks in advance for your precious time and consideration. Looking forward to hear from you as soon as possible.





Kindly note that I am using office 2019.
 

Attachments

  • MASTER DATA SHEET.png
    MASTER DATA SHEET.png
    248.4 KB · Views: 12
output sheet

my project.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
3MATRICULEFONCTION01020304050607080910111213141516171819202122232425262728TOTAL PRESENCETOTAL ABSENCE
4201101GUARDEPPPPPPPPPPPPPPPPPPPPPAAPPPRP252
5201102GUARDEPPPPPPPPPPPPPPPPPPPPPPMMMMPP240
6201103GUARDEPPPPPPPAAPPPPPPPPPPPPPPPPPPP262
7201104GUARDE000000000000000000000000000000
8201105GUARDE000000000000000000000000000000
9201106GUARDE000000000000000000000000000000
10201107GUARDE000000000000000000000000000000
ATTENDANCE REPORT
Cell Formulas
RangeFormula
C4:AD10C4=INDEX('MASTER DATA'!$A$1:$AJ$11,MAX(IF('MASTER DATA'!$A$8:$A$11=$A4,IF('MASTER DATA'!$I$8:$AJ$11<>"",IF('MASTER DATA'!$I$7:$AJ$7=C$3,ROW('MASTER DATA'!$A$8:$A$11))))),MATCH(C$3,'MASTER DATA'!$A$7:$AJ$7,0))
AE4:AE10AE4=COUNTIF(C4:AD4,"P")
AF4:AF10AF4=COUNTIF(C4:AD4,"A")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Dear Sir,

Master Sheet:

my project.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJ
7MATRICULENOMÉQUIPEFONCTIONCLIENTSITEREMARQUESUNIQUE_ID01020304050607080910111213141516171819202122232425262728
8201101MIDO MIWUMBUAGUARDECLIENT 1SITE ARAS201101_8PPPPPPPPPPPPPPPPPP
9201102AKANGA ALONDOAGUARDECLIENT 2SITE BRAS201102_9PPPPPPPPPPPPPPPPPPPPPPMMMMPP
10201103INGANGE EYENGABGUARDECLIENT 3SITE CRAS201103_10PPPPPPPAAPPPPPPPPPPPPPPPPPPP
11201101MIDO MIWUMBUAGUARDECLIENT 4SITE DTRANSFERT #101201101_11PPPAAPPPRP
12201104TEST 1ABGUARDECLIENT 5SITE E201104_12PP
13201105TEST 2AGUARDECLIENT 1SITE A201105_13PP
14201106TEST 3AGUARDECLIENT 7SITE F201106_14PPP
15201107TEST 4AGUARDECLIENT 8SITE G201107_15PPPAAAPPPP
16201107TEST 4AGUARDECLIENT 2SITE B201107_16RPPRAAAPA
MASTER DATA
Cell Formulas
RangeFormula
H8:H16H8=A8&"_"&ROW()
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I8:AJ16Cell Value="R"textNO
I8:AJ16Cell Value="M"textNO
I8:AJ16Cell Value="A"textNO
I8:AJ16Cell Value="P"textNO


Output Sheet/Report

my project.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
3MATRICULEFONCTION01020304050607080910111213141516171819202122232425262728TOTAL PRESENCETOTAL ABSENCE
4201101GUARDEPPPPPPPPPPPPPPPPPPPPPAAPPPRP252
5201102GUARDEPPPPPPPPPPPPPPPPPPPPPPMMMMPP240
6201103GUARDEPPPPPPPAAPPPPPPPPPPPPPPPPPPP262
7201104GUARDE000000000000000000000000000000
8201105GUARDE000000000000000000000000000000
9201106GUARDE000000000000000000000000000000
10201107GUARDE000000000000000000000000000000
ATTENDANCE REPORT
Cell Formulas
RangeFormula
C4:AD10C4=INDEX('MASTER DATA'!$A$1:$AJ$11,MAX(IF('MASTER DATA'!$A$8:$A$11=$A4,IF('MASTER DATA'!$I$8:$AJ$11<>"",IF('MASTER DATA'!$I$7:$AJ$7=C$3,ROW('MASTER DATA'!$A$8:$A$11))))),MATCH(C$3,'MASTER DATA'!$A$7:$AJ$7,0))
AE4:AE10AE4=COUNTIF(C4:AD4,"P")
AF4:AF10AF4=COUNTIF(C4:AD4,"A")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
You must adapt the formula, in this case change the "11" for the last row with data from the "MASTER DATA" sheet.


Rich (BB code):
=INDEX('MASTER DATA'!$A$1:$AJ$11,MAX(IF('MASTER DATA'!$A$8:$A$11=$A4,IF('MASTER DATA'!$I$8:$AJ$11<>"",IF('MASTER DATA'!$I$7:$AJ$7=C$3,ROW('MASTER DATA'!$A$8:$A$11))))),MATCH(C$3,'MASTER DATA'!$A$7:$AJ$7,0))

For example:
Rich (BB code):
=INDEX('MASTER DATA'!$A$1:$AJ$16,MAX(IF('MASTER DATA'!$A$8:$A$16=$A4,IF('MASTER DATA'!$I$8:$AJ$16<>"",IF('MASTER DATA'!$I$7:$AJ$7=C$3,ROW('MASTER DATA'!$A$8:$A$16))))),MATCH(C$3,'MASTER DATA'!$A$7:$AJ$7,0))

Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Dear sir,

Many thanks for the effort you did for me, actually it stills not working in my original data. Those ZERO's are annoying. Kindly note that check the formula again.
Please find below the report in my Original Project

PAYROLL SYSTEM.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAH
13MATRICULENOM ET POST NOMFONCTIONEQUIPE01020304050607080910111213141516171819202122232425262728JOUR PRESTÉJOUR ABSENCE
RP03
Cell Formulas
RangeFormula
F13:AF13F13=E13+1
 
Upvote 0
I show you how it works well for me.

varios 08jun2022b.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1
2
3MATRICULEFONCTION01020304050607080910111213141516171819202122232425262728TOTAL PRESENCETOTAL ABSENCE
4201101GUARDEPPPPPPPPPPPPPPPPPPPPPAAPPPRP252
5201102GUARDEPPPPPPPPPPPPPPPPPPPPPPMMMMPP240
6201103GUARDEPPPPPPPAAPPPPPPPPPPPPPPPPPPP262
7201104GUARDE00000000000000000000000000PP20
8201105GUARDE00000000P0000000000P0000000020
9201106GUARDE0000PPP00000000000000000000030
10201107GUARDEPPPAAAPPRPPRAAAPA00000P0000P107
Atrtendance report
Cell Formulas
RangeFormula
C4:AD10C4=INDEX('Master data'!$A$1:$AJ$16,MAX(IF('Master data'!$A$8:$A$16=$A4,IF('Master data'!$I$8:$AJ$16<>"",IF('Master data'!$I$7:$AJ$7=C$3,ROW('Master data'!$A$8:$A$16))))),MATCH(C$3,'Master data'!$A$7:$AJ$7,0))
AE4:AE10AE4=COUNTIF(C4:AD4,"P")
AF4:AF10AF4=COUNTIF(C4:AD4,"A")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Dear sir,

Many thanks for the effort you did for me, actually it stills not working in my original data. Those ZERO's are annoying. Kindly note that check the formula again.
Please find below the report in my Original Project

the formula isn't working correctly the output is not identical with the input. When I put the Formula in my project it is not working. I can't send you the whole data because of cell's limit to 3000 cells. In some cells it's giving #value error

waiting to hear from you.

Master Data = ATTENDANCE SHEET
New Microsoft Excel Worksheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1
2MOISFeb-22
3
4
5823000
6
7GUARDE SECURITY SERVICE - GSS
8FICHE DE PRESENCEPRESENCEABSENCERÈPOTEPROUVÈMALADE
9
10
11MATRICULENOMÉQUIPEFONCTIONCLIENTSITEREMARQUESUNIQUE_IDPRESENCEABSENCERÈPOTEPROUVÈMALADE01020304050607080910111213141516171819202122232425262728293031
12201681KANYINDA KABEYABGUARDECHADI_ARBIDARABIENOUVEAUX201681_1820000PP
13201682OMBENI MUNDEKUKUZABGUARDECHADI_ARBIDARABIENOUVEAUX201682_1920000PP
14201679IKASENGA INDOBGUARDECHADI_ARBIDARABIENVX PARTANT SANS DC201679_2163000PPPPPPAAA
15201677WONGOLA BADIBADIBGUARDECHADI_ARBIDKABOUL 2201677_2520000PP
16201677WONGOLA BADIBADIBGUARDEZAIDANJAMAIQUE201677_48110000PPPPPPPPPPP
17201681KANYINDA KABEYABGUARDERACHID_EL_CHAERCHICAGO 2NOUVEAUX201681_62170000PPPPPPPPPPPPPPPPP
18201682OMBENI MUNDEKUKUZABGUARDEKIN_MAGKAFRA 2NOUVEAUX201682_79170000PPPPPPPPPPPPPPPPP
19201677WONGOLA BADIBADIBGUARDEGSSPENTAGON 4201677_21580000PPPPPPPP
20201679IKASENGA INDOBGUARDEGSSPENTAGON 5NVX PARTANT SANS DC201679_21690000PPPPPPPPP
21201677WONGOLA BADIBADIBGUARDEGSSPENTAGON 5201677_27340000PPPP
22201679IKASENGA INDOBGUARDEGSSPENTAGON 4NVX PARTANT SANS DC201679_28540000PPPP
ATTENDANCE
Cell Formulas
RangeFormula
N5N5=COUNTIF($N$12:$AO$22,"P")
S5S5=COUNTIF($N$12:$AO$22,"A")
X5X5=COUNTIF($N$12:$AO$22,"R")
AC5AC5=COUNTIF($N$12:$AO$22,"E")
AH5AH5=COUNTIF($N$12:$AO$22,"M")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
N12:AO22Cell Value="A"textNO
N12:AO22Cell Value="P"textNO


REPORT SHEET
Cell Formulas
RangeFormula
A11A11=CONCAT("FICHE DE PRESENCE POUR LA PÉRIODE DU ",TEXT('[PAYROLL SYSTEM.xlsm]LISTE DE SALAIRE'!T2,"dd-mm-yyyy")," AU ",TEXT('[PAYROLL SYSTEM.xlsm]LISTE DE SALAIRE'!T3,"dd-mm-yyyy"))
F13:AF13F13=E13+1
A14:A17A14=IFERROR(INDEX(ATTENDANCE!$A$12:$A$600, MATCH(0,IF(ISBLANK(ATTENDANCE!$A$12:$A$600),1,COUNTIF($A$13:A13, ATTENDANCE!$A$12:$A$600)), 0)),"")
B14:B17B14=IFERROR(IF(A14="","",VLOOKUP(A14,'[PAYROLL SYSTEM.xlsm]EMPLOYEE MASTER'!$A$3:$D$499,2,0)),"")
C14:C17C14=IFERROR(IF(A14="","",VLOOKUP(A14,'[PAYROLL SYSTEM.xlsm]EMPLOYEE MASTER'!$A$3:$D$499,4,0)),"")
D14:D17D14=IFERROR(IF(A14="","",VLOOKUP(A14,'[PAYROLL SYSTEM.xlsm]EMPLOYEE MASTER'!$A$3:$D$499,3,0)),"")
E14:AF17E14=INDEX(ATTENDANCE!$A$1:$AR$22,MAX(IF(ATTENDANCE!$A$12:$A$22=$A14,IF(ATTENDANCE!$N$12:$AR$22<>"",IF(ATTENDANCE!$N$11:$AR$11=E$13,ROW(ATTENDANCE!$A$12:$A$22))))),MATCH(REPORT!E$13,ATTENDANCE!$A$11:$AR$11,0))
AG14:AG17AG14=IF(A14="","",COUNTIF(E14:AF14,"P")+COUNTIF(E14:AF14,"M")+COUNTIF(E14:AF14,"R")+COUNTIF(E14:AF14,"E"))
AH14:AH17AH14=IF(A14="","",COUNTIF(E14:AF14,"A"))
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E14:AF25Cell Value="M"textNO
E14:AF25Cell Value="E"textNO
A14:A25Expression=$A14<>""textNO
E14:AF25Cell Value="R"textNO
E14:AF25Cell Value="A"textNO
E14:AF25Cell Value="P"textNO
B14:AH25Expression=$A14<>""textNO
A14:A25Expression=AND($A14<>"",$AR$2=ROW())textNO
 
Upvote 0
1654800978642.png


In post #19 you put the row of headers of the "MATER DATA" sheet in row 7. But now you have them in row 11. You'll need to adapt the formula every time you move the headings, review my examples, and try to adapt the formula.
 
Upvote 0
Dear Sir,
I tried the formula again and it's working fine. but please help me to remove those annoying Zero's. You did a great job and the formula is really super complicated I don't know if you agree with me as an expert. Anyway I can't find the words to express you how much I am thankful to you.

I have another question which is related to Conditional Formatting and VBA can I Ask you again or not?

Waiting to hear from you dear.

Take care!
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

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