Adding two different COUNTIF formulas - countif

How can I add two different COUNTIF formulas that look at different criteria. For example:
Column A shows me dates 4/1/2013
Column B shows me the Type of product HQTT
I plug this formula in:
=COUNTIF(A:A,M3)+COUNTIF(B:B,"HQ TT")
However this gives me 2 when it should be 1 because I only have one row that says 4/1/2013 with the product HQTT.

Your formula is saying:
Count all the '4/1/2013' values in column A.
Count all the 'HQ TT' values in column B.
Give me the sum of these 2 counts.
I think what you want is a 3rd column, =A&B and a formula on that =COUNTIF(C:C,M3&"HQ TT")

For the sake of an answer, per OP:
I used this formula
=COUNTIFS(A:A,Q37,B:B,"HQ TT")
and Im getting the results I need.

Related

Pull Entire column from different sheet without zero's

how to pull column from different sheet..
I've a sheet using the below formula to get the column(n rows) from Sheet1 to Sheet2 however I'm getting zeros after nth row. How to avoid zeros here ??
=IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,"")
I'm doing the same for A,B,C columns to get data from Sheet1 to Sheet2. Any better formula ?
zeros are coming because the original column doesn't have data after nth row. for example if zero occur at 301 for column c means data in the column C has values upto 300 rows.
we can avoid this issue in two ways
stop copying formula after you get zeros
or
Put a unique word in the formula (here stopcopying)
=IF(LEN(IF(NOT(ISBLANK(Sheet1!C12)),Sheet1!C:C,""))=0,"stopcopying",IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,""))
Find "Stopcopying" keyword and replace without giving any word ( ctrl F and R)
This is the only way I can see and this answered my question:
=FILTER($B:$E,(B:B<>""))

Count the values from a variable column

I have a problem writing down a formula or a script in Google Sheet or Google App Script to find and count the values in a sheet where the number and references to the columns change.
I have a script that copy&paste the Sheet files for the staff shifts of every week from a Drive folder and merge them side by side (in horizontal).
In this sheet that contains all the shifts merged I want to count all the cells of the staff filtered only for handler and picker (column B, K, etc.) according to a specific date (row 3) for every hour.
Example: if today is 28/10/2020 find the right column with the same date in row 3 --> column E, count all the values from row 4 filtered by picker or handler for every hour (10 people at 05 AM).
Do you think that I can implement this with a formula (like a matrix, vlookup, etc.) or should it be written as a Script?
Thank you very much,
Marco
Please use the following
=COUNTA(QUERY({A3:I;J3:R},"select Col"&MATCH(A1,A3:I3)&"
where Col2 matches 'Technician|Picker' "))
Where B1 holds the date you wish to search for (28/10/2010)
Try the below formula. Replace date with your search date.
=COUNTA(INDEX(A4:R14,,MATCH(DATE(2020,10,28),A3:R3)))
This was earlier tagged as excel. This is how to "tackle" this in excel (office 365):
In a clear column use the following formula to get the unique hour-values that are in the column that equal today:
=UNIQUE(FILTER(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)),INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0))<>""))
In the column next to that type the following to get the result of the count of those unique values for that day:
=COUNTIF(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)), FILTER (I:I,I:I<>""))
Where I:I in FILTER (I:I,I:I<>"") needs to be changed into the column you put the first formula.

Counting same values between rows in Open Office Calc

(Open Office Calc) I have two rows of the same length, containing letters.
Suppose the two rows are A1:Z1 and A2:Z2.
I want to check if A1=A2, B1=B2, ... Z1=Z2 and output in one cell how many of these conditions are true.
I tried using COUNTIF but the condition can only refer to a fixed cell, not to a "moving" cell. In this case I would like to be able to write something like "COUNTIF(?1= ?2)" where "?" is the column index.
Any ideas?
Please try:
=SUMPRODUCT(A1:Z1=A2:Z2)

Using VLOOKUP formula or other function to compare two columns

I have one table like this:
SHORT TERM BORROWING
1/6/2009 94304
12/31/2010 177823
6/30/2011 84188
12/31/2011 232144
6/30/2012 94467
9/30/2012 91445
12/31/2012 128523
3/31/2013 83731
6/30/2013 78330
9/30/2013 70936
12/31/2013 104020
3/31/2014 62345
6/30/2014 62167
9/30/2014 63494
12/31/2014 104239
3/31/2015 69056
I have another column which lists each date from 2009 to 2015 in chronological order, like:
1/2/2009
1/3/2009
1/4/2009
1/5/2009
1/6/2009
1/7/2009
1/8/2009
1/9/2009
1/10/2009
1/11/2009
1/12/2009
1/13/2009
1/14/2009
1/15/2009
1/16/2009
1/17/2009
1/18/2009
1/19/2009
1/20/2009
1/21/2009
1/22/2009
1/23/2009
1/24/2009
1/25/2009
...
6/22/2015
I am trying to write a function that will take the values from the first table, and match them to their corresponding dates in the chronological dates column. Basically, I want the second column, which lists each date in chronological order, to have a value of "94304" for "1/6/2009", and then blanks until it reaches 12/31/2010, where it should have a value of 177823, and so on until 6/22/2015. I have tried using VLOOKUPs but no luck so far. What is the appropriate function?
If data in your first table starts at A2, and your other column starts at D2, then use in E2
=VLOOKUP(D2,$A$2:$B$17,2,0)
Copy down as needed.
I like Sancho.s' answer. I would include an IFERROR in your solution, so that if there is no answer corresponding to your search, you will not get #N/A.
Assuming your SHORT TERM BORROWING table is in columns A and B, and the dates you are searching are in column D, then the formula in column E would be:
=IFERROR(VLOOKUP(D2,A:B,2,FALSE),"")
This assumes that you want a blank cell as opposed to 0 in a cell that returns no value. If you want something else in there, replace the "" with another value.

I can't sum the values of a column whose values are generated using if statement

Sum function is not helping me sum the column, i even tried to manually enter all the cells but that also does not help. Even if there is values in the column, I get 0 as the answer in the cell where I have entered the sum function.
I have the following condition for 10 cells in a column =IF(B1=0,20,2) and then the sum for the cells =SUM(A1:A10). The column is autoupdated when B1 is updated and also the sum is updated when the values of the cells change.
If you have different workbooks the if changes to this =IF([d.xlsx]Tabelle1!$A$1=0,2,10). Where d.xslx is the name of the second workbook where you check the value Tabelle1 is the name of the sheet and $A$1 is the checked cell.
Make sure your IF formula does not have "" around your values. For example, make sure it looks like this: =IF(A1="Y",1,0)