Switch formula for SUM

What formula I will have to apply to calculate the total ATTENDED days in a month

1 Like

Interesting question, You can use SWITCH formula for the same.

Use: => SWITCH( INPUT, “Case1”, case1value, “Case 2”, case2value, defaultValue)

SUM(
SWITCH(D01,‘Attended’,1,‘Missed’,1,0),
SWITCH(D02,‘Attended’,1,‘Missed’,1,0),
SWITCH(D03,‘Attended’,1,‘Missed’,1,0),
SWITCH(D04,‘Attended’,1,‘Missed’,1,0),
SWITCH(D05,‘Attended’,1,‘Missed’,1,0),
SWITCH(D06,‘Attended’,1,‘Missed’,1,0),
SWITCH(D07,‘Attended’,1,‘Missed’,1,0),
SWITCH(D08,‘Attended’,1,‘Missed’,1,0),
SWITCH(D09,‘Attended’,1,‘Missed’,1,0),
SWITCH(D10,‘Attended’,1,‘Missed’,1,0),
SWITCH(D11,‘Attended’,1,‘Missed’,1,0),
SWITCH(D12,‘Attended’,1,‘Missed’,1,0),
SWITCH(D13,‘Attended’,1,‘Missed’,1,0),
SWITCH(D14,‘Attended’,1,‘Missed’,1,0),
SWITCH(D15,‘Attended’,1,‘Missed’,1,0),
SWITCH(D16,‘Attended’,1,‘Missed’,1,0),
SWITCH(D17,‘Attended’,1,‘Missed’,1,0),
SWITCH(D18,‘Attended’,1,‘Missed’,1,0),
SWITCH(D19,‘Attended’,1,‘Missed’,1,0),
SWITCH(D20,‘Attended’,1,‘Missed’,1,0),
SWITCH(D21,‘Attended’,1,‘Missed’,1,0),
SWITCH(D22,‘Attended’,1,‘Missed’,1,0),
SWITCH(D23,‘Attended’,1,‘Missed’,1,0),
SWITCH(D24,‘Attended’,1,‘Missed’,1,0),
SWITCH(D25,‘Attended’,1,‘Missed’,1,0),
SWITCH(D26,‘Attended’,1,‘Missed’,1,0),
SWITCH(D27,‘Attended’,1,‘Missed’,1,0),
SWITCH(D28,‘Attended’,1,‘Missed’,1,0),
SWITCH(D29,‘Attended’,1,‘Missed’,1,0),
SWITCH(D30,‘Attended’,1,‘Missed’,1,0),
SWITCH(D31,‘Attended’,1,‘Missed’,1,0)
)

You will then be able to see the Total count of days attended.

2 Likes