I have a table used to track document versions and whether or not a user has read the most up to date version.
I want to track the number of up to date documents read per user and I'm really struggling with CountIF.
How do I count the number of times UserA matches Doc version?
What I have tried is =COUNTIF(A1:A12, "="&B1:B12) which gives multiple rows of results I don't really understand. I have also tried =COUNTIF(A1:A12, "="&B1) but of course that just matched to B1.
Thanks
Question answered in comments by JvdV
=SUMPRODUCT(--(A2:A13=B2:B13))
You can at least attach a sample file.
=SUMPRODUCT(--(A1:A13<>B1:B13))
=SUMPRODUCT((A2:A23-B2:B23=0)*(A2:A23<>""))
=COUNTIF(A1, "="& B1) then copy/paste it to all cells
Related
After years of using this community, I have a question that I can't find an answer to. I hope you all can help!
I am trying to get a count of the number of "Grounded" items that each individual is overdue for. My screenshot (Count Tracker) shows a very condensed version of what I'm working with. Columns A-C is my large (15,000 rows) data field that is imported from an external source. In columns G-H I have listed each possible task (about 100 rows) and the type (Grounded and Non-Grounding plus many others). Column F is where I am trying to get the count.
My formula in F9 currently uses COUNTIFS to get a count of the instances in the large array that equal E9 ("Smith" in this case) and where the due date in the large array is less than or equal to the current date in F8. What I can't figure out is how to also add to count the Tasks in the large array where the task type in Column H equals "Grounded". I tried VLOOKUP, but it seems it doesn't like it and tells me there is a problem with the formula. It doesn't work, but here's the general idea of what I'm after:
=COUNTIFS($A$2:$A$7,$E9,$C$2:$C$7,"<="&$F$8,VLOOKUP($B$2:$B$7,$G$2:$H$4,2,FALSE),"=Grounded")
With how the data is currently presented, Smith should have a count of 1 and Jones should have a count of 0. I have a feeling that this is more simple than I'm making it to be, but I can't figure it out. I am using Excel 2016.
Hopefully I explained the problem well enough. Thank you for your assistance.
With Excel 2016 I'd say MMULT() is a good alternative here:
CSE-Formula in F9:
=SUM((A$2:A$7=E9)*(MMULT((TRANSPOSE(G$2:G$4)=B$2:B$7)*(TRANSPOSE(H$2:H$4)="Grounding"),ROW(G$2:G$4)^0))*(C$2:C$7<=F$8))
You could add a fourth column that stores whether that Task is Grounded
The formula for D2 would then be:
=INDEX($H$2:$H$4,MATCH(B2,$G$2:$G$4,0))
Modify your CountIfs formula to use this new column as a criteria
=COUNTIFS($A$2:$A$7,$E9,$C$2:$C$7,"<="&$F$8,$D$2:$D$7, "Grounded")
Try this Sumproduct+Vlookup formula without helper solution, and can work for your Excel 2016
In F9, formula copied down :
=SUMPRODUCT((A$2:A$7=E9)*(VLOOKUP(T(IF({1},$B$2:$B$7)),G$2:H$4,2,0)="Grounded")*($C$2:$C$7<=$F$8))
I'm using counting invoice numbers (text) in a table's column, but the Excel formula seems to be confusing some values.
I copied small sample of these - please refer to below:
The formulas are as follow:
=COUNTIFS(A1:A19,A1)
=COUNTIF(A1:A19,A1)
As you can see these invoice numbers differ and the results of these functions suggest as if all were the same.
I googled it for 1 hour but I didn't find such as issue as mine.
If anybody had any clue why could this behave in such way I'll be super grateful!
Rob
Each time you copy down this formula it will add 1 row to each. For example the second row of datas formula will be =COUNTIFS(A2:A20,A2). To lock these cells in the formula use $
Your formula should be =COUNTIFS(A$1:A$19,A1)
I've solved this myself:
ROOTCAUSE
Excel tried to be helpful and read these invoice numbers as actual numbers (despite these being defined already in Power Query as text)
Then, Excel fooled me and despite showing that it works on it as a string (I was evaluating the formula) it worked on it as number
Above means that it transformed exemplary "00100001010000018525" to 1.00001E+17, which cut down this to "100001010000018000" - that's the moment Excel stopped fooling around and showed that value in the formula bar.
I think I don't need to tell why countif perceived all these values as equal.
SOLUTION
I simply appended one letter after each invoice number to get e.g. "00100001010000018525a" what forces Excel to quit its gimmicks and games.
Case closed.
I suspect this is a bug in COUNTIF, or maybe by design.
However, to workaround this in the formula, without having to change your data, try adding a wild-card character:
=COUNTIF(A1:A19,"*"&A1)
Here is the formula I am using:
{=INDEX(AA$1:AJ$1831,MATCH(1,(AA$1:AA$1831=C2)*(AD$1:AD$1831=O2),0),10)}
It finds a number based on matching a name and hour of day. I need to refine this to also match day of week. The problem I am running into is that the day of the week is part of a string. Either "Sat,Sun" or "Mon,Tue,Wed,Thu,Fri".
How do I add to the formula above? to make:
{=INDEX(AA$1:AJ$1831,MATCH(1,(AA$1:AA$1831=C2)*(AD$1:AD$1831=O2)*(SEARCH(P2,AC:AC)),0),10)}
Please try:
{=INDEX(AA$1:AJ$1831,MATCH(1,(AA$1:AA$1831=C2)*(FIND(P2,AC$1:AC$1831)>0)*(AD$1:AD$1831=O2),0),10)}
Since you are looking for a number why not use SUMIFS to return a single value from a column based on multiple criteria? Arrays are old school and the SUMIFS function can accomplish the same. Search criteria can take on wildcards or use formulas like Mid,left, or right to strip a partial value out of a string.
Give it a try and reply back if you are still having problems.
I need to sum data based on 3+ criteria one being the month.
"Usage" tab contains entries forA=Date C=department, D=fuel E=Gallons
Im trying to generate a monthly report where the following is true
fuel=diesel, dept=public works, month=B2 (B2 is a month by number drop list, problem still exist if I substitute 1, 2, 3, etc.)
I can get the below formula to work until I add the date field, either I get #NAME?, or an error regarding my formula. Any suggestions would be appreciated.
=SUM(IFS(Usage!$E:$E,(Usage!$D:$D),"Diesel",(Usage!$C:$C),"Public Works",MONTH(Usage!A:A),B2))
Thanks
Vona
If B2 contains =MONTH(A2) (copied down), please try:
=SUMIFS(Usage!E:E,Usage!D:D,"Diesel",Usage!C:C,"Public Works",Usage!B:B,X2)
Note no parenthesis in the middle of SUMIFS. X2 (or to suit) contains the month number of your choice (so may not work across years).
This is the solution I found that provided the correct answer. Thanks to all who made helped, your suggestions pointed me in the right direction!
=SUMPRODUCT((Usage!D2:D6="Diesel")*1,(Usage!C2:C6="Public Works")*1,(MONTH(Usage!A2:A6)=B2)*1,(YEAR(Usage!A2:A6)=C2)*1, Usage!E2:E6)
I am a noob in excel, hence pardon me for any mistakes made.
This question must have been answered before but I couldn't find the right string to make it work for me.
There are around 500 rows and 20 columns (Yes, it is a report)
Column A has a few values (eg: Problem, Change, Request, etc.)
Column B has ticket numbers assigned to each entry. (No, I don't work for a call center, these are Datacenter Operations tickets)
Column B has several duplicate ticket numbers, as many people worked on same ticket OR the ticket was reopened for some reason.
I wish to take a count of unique ticket numbers from Column B when the condition in Column A is Change only.
So if there are 500 ticket number 250 are duplicate for sure, and only 25% of the rest will be Change tickets.
I am not supposed to use a Pivot or filter hence asking this question.
Need a formula to retrieve the count with the condition.
I may put the formula in Sheet2 or at the extreme right column, plz don't worry about it, I will take care of those things.
Many thanks in advance.
Adding to the question,
Let me help you with some data.
Change CRQ1110001
Problem INC1110001
Change CRQ1110001
Problem INC1110001
Change CRQ1110003
Problem INC1110003
Change CRQ1110004
Problem INC1110004
Change CRQ1110004
Change CRQ1110004
Problem INC1110005
Now I wish to only consider Change here without considering duplicate values.
Maybe this helps.
Thanks again.
Based on this website count unique values and with a small change this formula should work, expand the ranges to cover your entire range.
=SUM(IF(FREQUENCY(IF(A2:A10="change",IF(LEN(B2:B10)>0,MATCH(B2:B10,B2:B10,0),""),""), IF(A2:A10="change",IF(LEN(B2:B10)>0,MATCH(B2:B10,B2:B10,0),""),""))>0,1))
Entered with ctrl+shift+enter as it's an array formula.
Note that if you do this over the entire column A:A it will take quite a bit of time to compute as it has to go through a lot of calculations in the array formula.
If your "ticket numbers" in column B are actual numbers then you can use this formula
=SUM(IF(FREQUENCY(IF(A2:A500="Change",B2:B500),B2:B500),1))
confirmed with CTRL+SHIFT+ENTER
If not numeric you need to use a version as per gtwebb's suggestion