Find cells containing not null value between date range in Excel - excel

I have a table where Column A is a list of every day this year. In column E I have hours worked on each given day. Some of these cells are blank for days not worked. Because I've also entered work hours on some weekends, it's important I isolate the weekdays in this query
I need to know the number of WEEKDAYS from column A between the start date (A2) and TODAY where there IS A VALUE in column E.
In other words the number of NETWORKDAYS between A2 and TODAY where the value in column E is NOT NULL.

If you use Josh's suggestion but use a slight variation, e.g. in F2 copied down you can use this formula
=WEEKDAY(A2,2)
Using that version Saturdays = 6 and Sundays = 7 so to count weekdays so far this year with hours in column E you can then use COUNTIFS like this:
=COUNTIFS(A:A,"<="&TODAY(),E:E,"<>",F:F,"<6")
......or it's possible to do the same without a helper column (column F) if you use SUMPRODUCT, e.g.
=SUMPRODUCT((A2:A400<=TODAY())*(WEEKDAY(A2:A400,2)<6)*(E2:E400<>""))

The quickest way to do this is to add a column in which each cell is =WEEKDAY(A2), all the way down. This will give you the day of the week. Then just filter your data: assuming your weekend is Saturday and Sunday, filter out 1 and 7 in the 'weekday' column, then filter out blanks in Column E, and then just select Column A and the COUNT (number of cells) will be displayed in the bottom right corner.

Related

List adjacent cell values if date belongs to month 1, 2, 3 (jan, feb, mar...) etc

I have a list of dates in column B and a list of working hours in column C. I would like to get all the values (hours) listed in column D from column C if adjacent cell value in column B belongs to Month 1 (January).
Then I would like to drag the formula downwards and to the right so that column E = February, columnF = March etc.
The answer to column D should be a list with all the hours from column C that are in January in columnB and by dragging the formula down and to the right to get the formula working for all the other Months as well.
Note that the dates might be in disorder!
I've tried with INDEX MATCH but I can't get my different formulas to work with the MONTH() function. I've tried to find an answer to the problem for many hours now without success. All help appreciated.
Double check that your dates are being read correctly by first putting =MONTH(A2) and ensuring the appropriate value (1 - 12) comes out. Once you have verified that the following should do what you want.
In column D: =IF(MONTH($C2)=1,$B2,"") This formula can be dragged to the right first and replace 1 with 2 - 12 as appropriate for the month. Then copy them down.

How do I write an excel formula to count the number of a value in one column based off of a date in another column?

I have a worksheet and I'm trying to do a simple Count function, probably a countif but I'm unsure how to go about writing the formula.
I have two columns that I'd like to use for this formula.
Column N - I would like to filter for the Criteria of "C" or anytime a cell has a value of C
Column 0 - This column has dates filled in (short date format).
I would like to get a count of every C for each month, as simple as that.
In this example I filtered the date for May of 2017 and filtered for C under the Check column. We can see that there are 12 instances of C showing in the month of May 2017.
Does anyone know how to structure a formula that I would be able to Count the Number of C's for every month into the foreseeable future?
I figured out how to count the total present in a date range but unsure of how to add the date range plus Column N (Check) every time "C" is present in the cell.
=SUMPRODUCT((O:O>=DATEVALUE("5/1/2017"))*(O:O<=DATEVALUE("5/31/2017")))
Try this
=COUNTIFS(O1:O100,">="&A1,O1:O100,"<"&B1,N1:N100,"C")
Where A1 has the start date and B1 has the end date for that month. You can use DATEVALUE() instead of A1 and B1. Change as applicable
Screenshot
If you want to use SUMPRODUCT then see this
=SUMPRODUCT((O:O>=DATEVALUE("1/5/2017"))*(O:O<=DATEVALUE("30/5/2017"))*(N:N="C"))
In another column (lets say 'P' for example) I would insert a formula to give you the month number =Month(P7) - this will return 5 for May.
I would then use COUNTIFS (Like COUNTIF but it uses multiple criteria) to count where column N contains 'C' and column 'P' contains '5'.
=COUNTIFS(N:N,"C",P:P,5)
Try this....you need to select the entire Column B and named the column as 'Date'.enter image description here

Pull down / autofill a list of dates, but only weekdays, not weekends - excel

Ive want to pull down a list of dates in excel to auto fill a bunch of rows eg. type 03/03/17 and then pull down the cell to auto populate the dates all the way through march.
Normally this is straight forward, but in this instance im trying to get all of the workdays only and no weekend dates, how could that be done automatically without having to input all dates and remove rows where they fall on weekends ?
Put this formula below your first date and then autofill the formula down. make sure your first date is a weekday.
=IF(WEEKDAY(A1+1)<>7,A1+1,A1+3)
How it works
WEEKDAY(A11+1)<>7 if the cell above + 1 day is not Saturday then add a day A1+1 else add 3 days to the cell above A1+3.
You can copy and paste as values once you have the dates you need. You can also keep it as a template and change the first date to change all the dates below as required.
The WORKDAY(Start_date, Days [Holidays]) function returns the Monday to Friday dates based on a Start_date, number of days and optional Holidays array of dates.
Data Validation allows you to create a list of comma separated items or a named range of cells.
Create a list of Public Holidays in a column and name the range Holidays.
Enter a workday date in a cell (say G2) and in the cell below it (G3), enter this formula:
=WORKDAY(G2,1,Holidays)
Copy the formula down for about 65 rows (i.e. to cover 3 months allowing 22 workdays per month). Delete dates from the bottom of the list that are greater than your desired end date. Select the dates and name it Workdays.
In the range that you want to have dropdown lists:

How to count number of records active in all dates in Excel? [duplicate]

I have a sheet of trainings in excel that are organized by date and I am trying to do a monthly statistics report. So, I want to count, through an excel formula, the number of trainings that were done in the month that is specified in the header of the statistics column. The header has the month in number format and the dates in the training sheet are in 01/23/2015 format. For example, if the header of the stat column was "1" I would want to count all the trainings that were done in January 2015. Any help with this issue would be greatly appreciated!
If the dates of the exercises are in format mm/dd/yyyy I would suggest making a new column (in column B) for the month and a new column (in column C) for the year
The formula for extracting months from a column is
=TEXT(A1,"mmmm")
The formula for extracting years is
=YEAR(A1)
Add these formulas to columns B and C and now you can use the filters in excel to show only training exercises from the year and month you want. I think the filters are the best way to view the exercises you want and it is easy to get counts from these looking at the number of rows in the filter table.
However, if you want to show the number of exercises that occurred in a certain month/year you can write an if statement that will give a value of 1 if your criteria is matched and a value of 0 if the criteria is not matched. This will look something like this:
=IF(B1="January",1,0)
This will check if the month in column B is "January", then return the value 1 if it is "January". If it is not January, it will return 0.
To see the number of times a year appears use:
=IF(C1=2015,1,0)
This will check if the year in column C is 2015, than return the value 1. If it is not January, return 0.
Add these formulas to columns D and E.
Then sum the values in this column
=SUM(D1:D1000)
for month, and
=SUM(E1:E1000)
for year, and you will get the number of reports that matches your criteria. This is one way you can use Excel formulas to obtain the number of exercises in a certain month or year. If you have more than 1000 reports just change the number to 10,000 or more.
Hope this helps!
With the "header of the stat column" as A1 and the training dates in A2:A999 you could use,
=countifs(a2:index(a:a, match(1e99, a:a)), ">="&date(2015, a1, 1), a2:index(a:a, match(1e99, a:a)), "<"&edate(date(2015, a1, 1), 1))

Count all records from certain month in excel

I have a sheet of trainings in excel that are organized by date and I am trying to do a monthly statistics report. So, I want to count, through an excel formula, the number of trainings that were done in the month that is specified in the header of the statistics column. The header has the month in number format and the dates in the training sheet are in 01/23/2015 format. For example, if the header of the stat column was "1" I would want to count all the trainings that were done in January 2015. Any help with this issue would be greatly appreciated!
If the dates of the exercises are in format mm/dd/yyyy I would suggest making a new column (in column B) for the month and a new column (in column C) for the year
The formula for extracting months from a column is
=TEXT(A1,"mmmm")
The formula for extracting years is
=YEAR(A1)
Add these formulas to columns B and C and now you can use the filters in excel to show only training exercises from the year and month you want. I think the filters are the best way to view the exercises you want and it is easy to get counts from these looking at the number of rows in the filter table.
However, if you want to show the number of exercises that occurred in a certain month/year you can write an if statement that will give a value of 1 if your criteria is matched and a value of 0 if the criteria is not matched. This will look something like this:
=IF(B1="January",1,0)
This will check if the month in column B is "January", then return the value 1 if it is "January". If it is not January, it will return 0.
To see the number of times a year appears use:
=IF(C1=2015,1,0)
This will check if the year in column C is 2015, than return the value 1. If it is not January, return 0.
Add these formulas to columns D and E.
Then sum the values in this column
=SUM(D1:D1000)
for month, and
=SUM(E1:E1000)
for year, and you will get the number of reports that matches your criteria. This is one way you can use Excel formulas to obtain the number of exercises in a certain month or year. If you have more than 1000 reports just change the number to 10,000 or more.
Hope this helps!
With the "header of the stat column" as A1 and the training dates in A2:A999 you could use,
=countifs(a2:index(a:a, match(1e99, a:a)), ">="&date(2015, a1, 1), a2:index(a:a, match(1e99, a:a)), "<"&edate(date(2015, a1, 1), 1))

Resources