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!)
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 am currently trying to create an if statement that sums values based on whether a date has passed.
Excel example image
M1 to M12 dictate the months of the year e.g. 01/01/2021 for M1 and 01/12/2021 for M12
Now I want to create or use a formula that sums the values in row 4 based on what month we are currently in --> If we are currently in M1, e.g. 15/01/2021, then it only needs to sum the value in A4. However, if we are, for example, in M3 (28/03/2021) then it needs to sum A4 + B4 + C4
I tried using the following formula but the problem is that when it finds a value larger than 01/01/2021 it doesn't take other months into consideration anymore
=IF(TODAY()>=A2;A4;IF(TODAY()>=B2;SUM(A4:B4);0))
I added the zero at the end of the function to close the formula but my idea was to prolong it up til 12 months. However, it only ever sums the first cell (A4) because conditions have already been met. How do I 'overwrite' the first condition if more months have passed?
Any help would be greatly appreciated; I excuse myself for asking potentially dumb questions but Excel isn't my strong point and I am trying to learn.
Kind regards,
VHes
Try:
=SUM(INDEX(4:4,SEQUENCE(MONTH(TODAY()))))
An alternative approach using SUMIF:
=SUMIF(A2:L2,"<"&EOMONTH(TODAY(),0),A4:L4)
If SEQUENCE is not supported by your version of excel, (based on comments it does), you could also try the following:
=SUM(A4:INDEX(A4:L4,MONTH(TODAY())))
The trick here is that INDEX actually supplies a cell address, and displays the contents of that cell when needed.
Excel formula stop working after x number of rows
A similar question was posted 4 years ago. There were two answers. I have reviewed both. The first response is excellent but it is not the cause of my issues. The second answer was a statement that the person who responded had the same issue and what he or she did to solve it which will not work in my case. There was no explanation as to why the problem occurred.
Here is my problem. I am using the following formula:
IF(MONTH(MDB.xlsx!Date)=7,SUMIFS(MDB.xlsx!_910,MDB.xlsx!Activity,"MGRINC",MDB.xlsx!AcctNum,$Y202),0)
MDB is a Master Data Base. It currently has 214 rows but will grow substantially to probably around 5000 rows. The named ranges in the MDB are currently defined as rows 1 to 500. The above formula is in a spreadsheet, with about 300 rows. The formula works fine through row 201. From 202 on, it only returns zeros.
This is what I have done:
I have looked at constituent parts of the formula using F9, all values and arrays are reporting correctly. (That’s why the defined name range is currently set to only 500 rows, so I can breakdown a formula using F9 and not get an error after 8,192 characters.)
If I move the line with this formula from line 202 to an earlier row, it works fine.
If I delete earlier rows, the formula works fine.
This appears to be a memory issue of some sort but I don’t understand why. I have built larger and much more complex spreadsheets some of which take minutes to calculate with no issues.
Any thoughts?
Extracting the Month inside a Sumif will not work. You could add two conditions, one testing for the date being greater/equal to July 1, the second testing for the date being smaller/equal to July 31.
=SUMIFS(MDB.xlsx!_904,MDB.xlsx!Date,">="&date(2020,7,1),MDB.xlsx!Date,"<="&date(2020,7,31),MDB.xlsx!Activity,"MGRINC",MDB.xlsx!AcctNum,$Y202)
Or, you could add a column to your source data that has the month number, then test for that month number
Or, you could change the formula to use SumProduct instead of Sumif, incorporating the month filter into the SumProduct parameters like this:
=Sumproduct((MONTH(MDB.xlsx!Date)=7),--(MDB.xlsx!Activity="MGRINC"),--(MDB.xlsx!AcctNum=$Y202),MDB.xlsx!_910)
With the formula just testing form Month number, the year is disregarded, so if you have data spanning multiple years, you may want to add a parameter that checks the year.
Note that all these formulas are regular formulas and do not need to be array entered.
This is basically about overtime calculations, but I want it calculated separately. IF(A1>8,A1-8,0)
I want A1 when it reaches 8, to flow over to I1. Now I know this formula...
But additionally I would also like B1, C1, and D1 to do the same. So what I'm saying is that each of those cells when a value above 8 is input, I would like it to flow into I1 aswell. That's one part of it, also I would like any amount that is input to cells E1, F1, and G1 to flow into I1 . The final 3 cells are basically weekend work and considered by my company as overtime.
=SUMPRODUCT((A11:G11>H3:N3)*(A11:G11-H3:N3))
So this one works guys but, what I want to do is grab from two separate rows for the seven days of the week. Like this.....
=SUMPRODUCT((D11:G11,A13:C13>H3:N3)*(D11:G11,A13:C13-H3:N3))
But what I'm getting now is #VALUE! I'm not sure what I'm doing wrong.
I would like to know if this is possible and will greatly appreciate the help solving this problem.
So Seeming no one answered you guys decided to minus my rep, I stumbled on the answer myself. I worked this out by making a table with each day and the hours of single time in them.
For the purpose of this formula below I'll say K3 is Sunday and that D19 is also the hours worked on the Sunday. It tells the cell to compare the number input to D19 and if greater than, then minus what is in K3 and return the value in the cell I have input the formula. Because this is for overtime I wanted it to add up each day separately and give me a running total through the week. This Formula worked perfectly for me.
=SUM((D19>$K$3)(D19-$K$3),(O11>$L$3)(O11-$L$3),(P11>$M$3)(P11-$M$3),(Q11>$N$3)(Q11-$N$3),(K13>$H$3)(K13-$H$3),(L13>$I$3)(L13-$I$3),(M13>$J$3)*(M13-$J$3))
Feel free to copy and paste and change it to suit your needs.
I have a table in Excel which has the columns:
Date
Person Name
Amount (£)
The table is used to record when people pay me money. Typically, I can get more than one person paying me on the same day. Also, the same person will pay me on many days over the course of time.
Records are added to the bottom of the table so the ordering will be on date but no further ordering on name or amount.
Using formulas, is there a way I can retrieve the most recent amount for a specific person?
If this is too complicated or not possible then I can settle for the following work around:
Add a 4th column to the table called "Last". This will display TRUE if it is the last entry for a specific person, FALSE if it is not.
It felt like there should be a fairly straight-forward answer to this but I found it quite a head scratcher so was interested to see an answer.
Having done some googling I came across a solution posted on a dedicated excel site (view here). [NB - look under the header 'Arbitrary Lookups']
Applying it to your example, suppose your data is in A1:C10 and in cell D2 you want to type a name and return the most recent payment in cell D3:
1 Date Name Amt EnterName
2 20 Jul Bob 50 <enter name here>
3 13 Sep Susan 20 = enter formula here (see below)
4 06 Jan Xavier 100
In cell D3 enter the following as an array formula (i.e. type in formula and then press CTRL + SHIFT + ENTER
=INDEX($B$2:$C$10,SMALL(IF(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1)=$D$2, ROW(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1))-ROW(OFFSET($B$2:$C$10,0,0,1,1) )+1, ROW(OFFSET($B$2:$C$10,ROWS($B$2:$C$10)-1,0,1,1))+1),COUNTIF(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1),$D$2)),2)
It would recommend checking out the link I provided if you want more detail. For clarity, I have merely adapted the formula (changed cell references) from the link provided.
Here's one way to do it based on an answer I gave in a previous SO post.
=INDEX($C$1:$C$19,MATCH(MAX(IF($B$1:$B$19="PersonNameHere",$A$1:$A$19,0)),IF($B$1:$B$19="PersonNameHere",$A$1:$A$19,"")))
Where A is the Date column, B is the Person Name column, and C is the Amount column. You must enter this as an array formula by pressing Ctrl+Shift+Enter.
I can't see right here an easy way to do it in only one formula.
If you have your data from A2 to C11.
You can add this formula on the 4th column (let say in cell D2):
{=MAX(IF($B$2:$B$11=B2,$A$2:$A$11,0))}
This is an array formula you have to validate with Ctrl-Shift-Enter
This will tell you what is the last date for the current person.
And then find the last amount with another column (let say in cell E2) and use this formula:
=INDEX($C$2:$C$11,MATCH(D2,$A$2:$A$11,0))
[EDIT] I've just tried to combine the formulas into one and that simply works:
{=INDEX($C$2:$C$11,MATCH(MAX(IF($B$2:$B$11=B2,$A$2:$A$11,0)),$A$2:$A$11,0))}
and this is still an array formula.
Alas, #Excellll was smarter (and faster) and gave the solution at first shot