# 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