Excluding certain columns from Countif

Jelsey

New Member
Joined
Apr 24, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello All,
I am looking for help with a formula. I have arranged a horizontal calendar and added a Countif formula at the end to total days that were missed from work. The formula countif formula is counting the cells that have 1 listed in them. However, i want to exclude the columns that have weekend dates. There are numbers in them but I only want to count business days.


Is there a way to exclude those columns? Or a better formula I should be using?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Of course. This is just a snit of the table. Each cell under a date is populated with .5 (half day off) 1 (full day off). I have table set to change color based on the value entered. 1 = light green. (First picture)


1682361486616.png


I need to count all the "1" in the row. which I used the formula Countif (Second picture) However, I need the Countif to exclude the columns that are weekends. Which in the picture would be Column NA and NB. (and 51 other columns that are weekend dates)


1682361456350.png



Is there a formula or combination of formulas that could help? Or maybe I'm using the wrong one.
Ultimately I want to use the weekend column to total off days for the week. and have the Grand total at the end. as shown above.
 
Upvote 0
How about
Excel Formula:
=COUNT(FILTER(B3:NB3,(B3:NB3=1)*(WEEKDAY(B1:NB1,2)<6)))
 
Upvote 0
Solution
HOLY ****!! THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

I been struggling with this for almost 2 days. I appreciate your help sooo much. Could I ask for help with one more formula. As I mentioned above I would like to use the weekend columns to total offs per week. However I want it to be cumulative. So in column H, would have the off days totaled from column C - G. and then in Column O would have the total days off from Column C - D and J - N, and column V would have the total days Off from Column C - D and J - N and Q - U (and so on). What would be a good approach for that?



1682362704154.png
 

Attachments

  • 1682362860891.png
    1682362860891.png
    6.9 KB · Views: 3
Upvote 0
As that is a significantly different question it needs a new thread. Thanks
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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