 # Excel Formula to count #of M on Weekends

• Friends, I am looking for a excel formula which would calculate the count of M in each row by checking the weekdays row for Sat and Sun.

Like in my spreadsheet attached, on the Row 3 i have only 1 M showing under Sat and Sun, so the result should be 1. And similarly in the next row i have 3 M for Sat and Sun, hence the result is showing as 3.

Pls let me know if my question is not clear.. Thank you in advance.

## Files

• Re: Excel Formula to count #of M on Weekends

1 way..

=COUNTIFS(\$B\$2:\$O\$2,"Sat",B3:O3,"M")+COUNTIFS(\$B\$2:\$O\$2,"Sun",B3:O3,"M")

Regards

Fotis :hammerhe:

[SIZE=4]. [/SIZE]Array(CSE) { }, formulae are confirmed with CONTROL+SHIFT+ENTER.

[SIZE=4]. [/SIZE]-Replace commas ( , ) with semicolons ( ; )-or vice versa in formulae, if your locale setting demands.

[SIZE=4].[/SIZE]--Don't attach a screenshot--Just attach your Excel file!

[SIZE=4].[/SIZE]--[SIZE=3]KISS[/SIZE]([SIZE=2]Keep it simple Stupid[/SIZE])

• Re: Excel Formula to count #of M on Weekends

Thank you so much!

• Re: Excel Formula to count #of M on Weekends

Oh well, now how do i put the below Excel formula in VBA code.. Because i tried recording this and realized that my range is not constant and not giving me the desired result.

=COUNTIFS(\$B\$2:\$O\$2,"Sat",B3:O3,"M")+COUNTIFS(\$B\$2:\$O\$2,"Sun",B3:O3,"M")

• Re: Excel Formula to count #of M on Weekends

Now is(for sure) an issue for Pike!:surfing::surfing: I have no idea about VBA!

Regards

Fotis :hammerhe:

[SIZE=4]. [/SIZE]Array(CSE) { }, formulae are confirmed with CONTROL+SHIFT+ENTER.

[SIZE=4]. [/SIZE]-Replace commas ( , ) with semicolons ( ; )-or vice versa in formulae, if your locale setting demands.

[SIZE=4].[/SIZE]--Don't attach a screenshot--Just attach your Excel file!

[SIZE=4].[/SIZE]--[SIZE=3]KISS[/SIZE]([SIZE=2]Keep it simple Stupid[/SIZE])

• Re: Excel Formula to count #of M on Weekends