Automatically increment a COUNTIF date criterion - google-sheets

https://docs.google.com/spreadsheets/d/1EUgEwLmiNv9ug66DWzXjnuZ2GzavSbNqs-UTysiwZbM/edit?usp=sharing
I have this Google Sheets with multiple tabs that record projects published on a date.
One of the tabs (Stats) records the total number of projects published by everyone on a particular day. I am using COUNTIF in the last tab to record productivity. I don't want the range to change when I drag the formula: I want the criterion to add a date automatically so as to get the result for the next day. I am having to re-write the formula.
Bob on the left, Randy on the right:
Output (Stats):

In Stats!C2 and copied across and down to suit:
=countifs(indirect(C$1&"!A:A"),"="&$A2,indirect(C$1&"!C:C"),"Done")
should be sufficient, provided you make the column labels in Stats match the sheet names (even for spaces).

Related

Match and count in a vacation tracking sheet

My team has a vacation tracking calendar in Google Sheets. I'm trying to create a formula (for the red cells) to automatically count the number of days entered in the calendar by person and absence code.
I've tried a number of different ways to solve this using Countifs, Match and Index but it only works for a single range, yet I need to count one range for each month of the year.
Is there an easier way to do this than adding 12 similar formulas together.
Assuming you don't need a spill range you could just do a basic countif off of a filtered range on the name.
so if your data starts on A8 and goes all the way to column f (you'd want more), and you put the exact string you're searching above the cell in row 3, this should work:
=countif(filter($A$8:$F,$A$8:$A=$C3),D$2)
Here's a sample sheet from screen shot.

How can I count the number of items listed on a different google sheet based on dates in 2 different cells and if another cell is blank?

I have a google doc that tracks information about employee training (Example 1). I have another google doc that needs to summarize the information (Example 2) from multiple different sheets which mirror example 1 but for different teams.
Example 1: this sheet is tracking employees start dates, dates they finish training, and if they have quit. (there are multiple different docs all with the same format that I'm pulling from using importrange).
I need a formula that will count the number of employees currently in training. So count if start date is equal to or after today, end date is equal to or less than today, and the quit column is blank.
If the formula worked the way it should, and I was looking at the summary doc on 11/10/2021, it should report 4 people in the "# in Training" column on the table below (Example 2).
I have tried using an ArrayFormula with CountIfs to accomplish this, but it still pulls 0. Here is the formula I've been playing with:
=ArrayFormula(COUNTIFS('tracker'!$B$2:$B, "<="&TODAY(), 'tracker'!$C$2:$C, ">="&TODAY(), 'tracker'!$D$2:$D,""))
Give a try on below formula-
=COUNTIFS(B2:B8,"<=" & DATE(2021,11,10),C2:C8,">=" & DATE(2021,11,10),D2:D8,"")

Formula for looking up and filtering data from a sheet

I want to do a complex formula using google sheets:
I have a list of place that will be visited by different people.
Some places are not to be visited, marked with /
Some places need to be assigned, marked with ?
Wanted outcome:
A list of cells that changes every day automatic.
An overview of who is going where that day and what needs to be assigned.
So I need a formula that can select a row based on today() and then filter out Persons in that row. Then for each person, another formula that looks up the first row in the table and puts duplicates together.
Example:
Wanted outcome:
Link to excel file, but it needs to work in google sheets too: xlsx
My solution is not the most elegant but it does the job.
First I build a column with date and unique persons or ? in this column:
=unique(sort(transpose(index(A1:H10,match(today(),A1:A10,0)))))
Then I find Places corresponding to these persons (I use filter function for it and then I use textjoin to keep them in single cell).
The formula is copied down as filter function does not accept a range and arrayformula as a filtering criterium.
My solution is available here:
https://docs.google.com/spreadsheets/d/1GTy_UaFP8LbA8OLnEhT_R_twpDCIWCuvQfBAigqtbR0/copy

Compare data google sheets

I am using google sheets and I want to compare the quantity of interactions o a given person in a period of time.
My problem is that between one week and another, the people can change, some people can have no interactions and is not reported and I can have new people.
So I need a formula that allow me to compare the previous period of time but also the name.
I am trying this in order to follow up how the people's behavior is changing.
This is the example spreadsheet.
Thanks
This is an easy, quick-and-dirty solution using vlookup.
There are two variations. One using a single criteria and one using multiple criteria. infoinspired.com has a good article on How to Use VLOOKUP with Multiple Criteria in Google Sheets.
Single Criteria: This is the formula.
=iferror(vlookup((B2+1)&C2,$A$2:$D$9,4,false),"error")
This involves a cheat by creating a new column A which contains the concatenation of the date and name values for each row. This is a unique value.
The lookup criteria is the (date (B2) plus 1=the next day) and the name.
The lookup range is self-explanatory and the value returned is the Quantity (from column 4).
The vlookup formula is inside an iferror() so that any problems are highlighted.
Multiple Criteria: This uses an array formula.
=ArrayFormula(iferror(vlookup((B2+1)&C2, {B2:B&C2:C, D2:D}, 2, 0 ), "error"))
The vlookup component is very similar to the "simple" formula. The difference is that each criteria 1:(Date plus 1) and 2:Name are recognised separately, and assigned discrete lookup columns (B and C respectively).
Again, the whole thing is wrapped in an iferror statement to highlight any problems.
This spreadsheet shows the workings:

SUMIF/SUMPRODUCT match multiple criteria within date range

I have a table (Sales) data that has two sets of columns with code, amounts and date reference:
And I have another table (Sheet1):
which need to sum the total net amount with one set subtract the other set on the Sales table but it have to matched the code and based on the weekly date range in Sheet1 table. I can sum the total amount together but I can't separate it with date.
Try:
=SUMIFS(Sales!I:I,Sales!F:F,$A4,Sales!G:G,$C4,Sales!H:H,">="&Sheet1!D$1,Sales!H:H,"<="&Sheet1!D$2)
IF you want the difference between the sum of the blues and the sum of the reds subject to the same conditions, repeat the above (with adjustments to suit) at the beginning and link the two together with a -.
I've work this one out. This is my formula:
=SUMPRODUCT(--(Sales!$C$1:$C$1000>=$C$1),--(Sales!$C$1:$C$1000<=$C$2),--(Sales!$A$1:$A$1000=A4),Sales!$D$1:$D$1000)-SUMPRODUCT(--(Sales!$H$1:$H$1000>=$C$1),--(Sales!$H$1:$H$1000<=$C$2),--(Sales!$A$1:$A$1000=A4),Sales!$I$1:$I$1000)

Resources