How to write the formula to make this happen in Excel - excel

Please refer the below screenshot:
Assume that today's date is 29-4-2018 (dd-mm-yyyy). There are two users (User 1 and User 2). Both of them have worked in various Workspaces (Workspace1, Workspace 2 and Workspace 3) on different dates.
I want to calculate the number of jobs a user has done on today's date in various workspaces and then display the count in cell C2 and C3 respectively so that the result is something like this:
Any Idea how to write a formula to achieve this result?
P.S. I know I have to try it first, but I a complete newbie to excel and don't know much except for very basic formula. For this one, I don't even know where to start.
EDIT:
Just in case if anyone wants to download this workbook

Use the following formula in C2 cell
=COUNTIFS($B$8:$B$26,B2,$D$8:$D$26,"29-04-2018")+COUNTIFS($E$8:$E$26,B2,$G$8:$G$26,"29-04-2018")+COUNTIFS($H$8:$H$26,B2,$J$8:$J$26,"29-04-2018")
If it is actually today then you can replace 29-04-2018 with Today() so, the formula will be
=COUNTIFS($B$8:$B$26,B2,$D$8:$D$26,TODAY())+COUNTIFS($E$8:$E$26,B2,$G$8:$G$26,TODAY())+COUNTIFS($H$8:$H$26,B2,$J$8:$J$26,TODAY())
Edited answer from Scott Craner comments
=COUNTIFS($B$8:$H$26,B2,$D$8:$J$26,TODAY())

Related

Use VLOOKUP as criteria inside COUNTIFS

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))

Custom formatting in Excel

I have the following problem in excel.
Lets say I have 10 cells in my spread sheet that contains the following;
Cash per 30.06.17
I want to use the Concatenate-formula (or other if that solves my problem) in order to be able to use a referance cell to change the date going forward in all 10 cells.
=concatenate("Cash per";"referance cell that contains the date)
However, when doing this I receive the following;
Cash per 42916.
Can somebody help me with this problem? The way I see it I need a special input to the custom category in cells formatting.
Thank you.
Andreas
You have to add the "TEXT"-function to your formula to format the date:
=CONCATENATE("Cash per";TEXT([Reference cell with date];"dd.mm.yyyy"))

excel count sets of dates that date is between

Here is my data model: I have an excel sheet with each row representing a date range (an event). There is significant overlap. A2 might be 4/10/15, and B2 might be 4/12/15; while A3 might be 4/11/15 and B3 might be 4/12/15.
I am trying to get a count for each day of the year 2015 how many events occurred on that date. with my limited "for instance" I would get something like:
4/9/15 0
4/10/15 1
4/11/15 2
4/12/15 2
4/13/15 0
I have some sudo code for this if I were to just save the set as a csv and use java or something to grab each date and create an object but I find it hard to believe that excel is not capable of this on it's own.
We tried a wild number of countif and countifs statements but I am really just at a loss when it comes to excel.
I thought I was close with this:
=COUNTIF(Sheet2!A2,AND(Sheet2!A2>=(dates!B*), Sheet2!A2<=(dates!C*)))
but in order to get that to work I would need it to iterate through each row of dates and I am just not sure how to do that.
Any help is appreciated. As a backup plan I am refining my sudo-code for a possible vb excel script (never done that before) or just breaking it out into java and using the old text edit scripts I haven't had to touch since college labs.
Thank you for any help.
Your keyword is COUNTIFS
Say your criteria day is in cell Sheet2!A2 and your event ranges are in sheet Dates columns B and C; Try this formula:
=COUNTIFS(Dates!B:B, "<="&Sheet2!A2, Dates!C:C, ">="&Sheet2!A2)

SUMPRODUCT several ifs

I´ve spent a lot of time with a formula in Excel and I´m still blocked. I hope you can help me.
I have a table in Excel with several values as shown in this
screenshot.
What I´m trying to extract is the number of Fruits sold in a specific month. That is, how many lemons were sold in January 2016, for example. This is the formula I´m using:
=SUMPRODUCT((B3:B38=E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
But the result is #N/A as seen in the screenshot.
What Am I doing wrong? Any help, please?
Thanks a lot in advance!
You can use arrays in excel to get this answer
{SUM(IF(MONTH(F$3&"1")=MONTH($A$3:$A$150),IF($E4=$B$3:$B$150,$C$3:$C$150,0),0))}
You can use this Sumproduct formula which uses array logic:
SUMPRODUCT((MONTH($A$3:$A$38)=MONTH(TEXT(G$2,"MMM")&1))*($C$3:$C$38=$F4)*
($D$3:$D$38))
Sumproduct Demo
Part of your problem is your ranges are not equal in length. B3:B38 has to be the same number of rows as $A$3:$A$150 and C3:C150. When rows are not equal things blow up on you.
=SUMPRODUCT(($B$3:$B$150=$E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
if you change your header row to be actual excel date format, and then change the cell display format to just show the month (as suggested by csanjose), then you can adjust your sumproduct formula as follows and copy to all cells in your table.
=SUMPRODUCT(($B$3:$B$38=$E4)*(MONTH($A$3:$A$150)=Month(F$3))*(YEAR($A$3:$A$150)=Year(F$3));$C$3:$C$150)
Fill your month-row with the last day of each month, then apply date format to show only month name.
The formula you should use is, for example, in g8:
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&G$3;$A:$A;">"&F$3)
First column "F" doesn't have a column on the left to compare, so you can put a date in E3 or change a bit the formula (example of F8):
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&F$3;$A:$A;">2015/12/31")
Take a look at the result
If you don't want to use a pivot table, you can use this formula to get what you need:
=SUMPRODUCT(($B$3:$B$150=$E3)*(MONTH($A$3:$A$150)=1)*(YEAR($A$3:$A$150)=2015)*$C$3:$C$150)
Then drag-fill the cell to copy it to every month column (just make sure you change the month number in the formula (and year if you're doing that too)), and then drag-fill down the columns.
That should work pretty food good :)
Good Luck!

EXcel formula : Summation based on same numeric input

The requirement is that I have the following sample data in Excel 1
ticket hours
----------+------
1.131233 44
2.12312 12
3.131233 33
4.12312 12
In Excel 2 (different workbook),
we have the same layout, however there would be single entries for each ticket and the hours summed up corresponding to each ticket.
ticket hours
---------+-------
1.12312 24
2.131233 77
the formula that I have started with to sync any changes in excel1 to excel 2 is
=[Source.xlsx]Sheet1!$B:B
where source.xlsx is the excel1
But, obviously this does not do any summation, just syncs data, I haven't been able to suitably modify this to fit my requirement.
EDIT
Based on the given link I edited the formula
PFB the source and destination
destination with the new formula looks like below
the formula used is:
=SUMIFS('D:\Users\...\Desktop\POC - files\[Source.xlsx]Sheet1'!$B:B,'D:\Users\...\Desktop\POC - files\[Source.xlsx]Sheet1'!$A:A, B2)
Now this does not work, probably because of some silly issue, would be great if someone pointed out!
EDIT
The below given formula does not work...
Also , this would do it only for one ticket, not for all tickets in the column A
EDIT
Formula used
=SUMIFS('C:\Users\kphil\Desktop\POC\[source.xlsx]Sheet1'!$B$2:$B$65535,'C:\Users\kphil\Desktop\POC\[source.xlsx]Sheet1'!$A$2:$A$65535, A2)
In your formula it should be A2 instead of B2 in Criteria1. The second formula is a sum product which will work when the workbook is closed.
=SUMIFS('D:\Users\...\Desktop\POC - files\[Source.xlsx]Sheet1'!$B$2:$B$65535,'D:\Users\...\Desktop\POC - files\[Source.xlsx]Sheet1'!$A$2:$A$65535, A2)
=SUMPRODUCT(('C:\Users\kphil\Desktop\POC\[source.xlsx]Sheet1'!$A$2:$A$65535=A2)*('C:\Users\kphil\Desktop\POC\[source.xlsx]Sheet1'!$B$2:$B$65535))
You can also use Pivot - it is very easy once you get the hang of it. If you want to average your no of hours as against say sum, that can be done as well. (Or max/min/stdDev/etc) Here's a link that explains how. Once you are comfortable with playing around the labels, you'll not need to enter formulae ever again.
PS: would have said all this in a comment, but don't have the reputation (sorry!)

Resources