Total sum using specific text and date - excel

I was wondering if anyone can help me with this as I have had a look everywhere online and can’t seem to get the correct answer.
I have a very large complicated excel sheet that contains products I have bought over several months.
What I am trying to achieve is to do a total sum using specific text within a time frame. I have managed to achieve the total sum using specific
Text by using this formula
=SUMIF(A2:A8,"apple",B2:B8)
But now what I want to do is add an extra string if possible to look between dates so that it looks for the sum apple of ‘apple’ within January.
Example of sheet
A B C
product price date
apple £150.00 Jan-16
apple £150.00 Feb-16
pear £100.00 Jan-16
pear £100.00 Feb-16
apple £150.00 Jan-16
banana £200.00 Feb-16
banana £200.00 Feb-16
Apple Total
Jan Feb March
**£450.00**
Pear Total
Jan Feb March

Your dates look as if they are dates showing just month and day, so Jan-16 would be stored as 1-Jan-16. In this case you could use a SUMIFS like this
=SUMIFS($B$2:$B$8,$A$2:$A$8,$E1,$C$2:$C$8,DATEVALUE(E2&"-16"))
where the fruit to be matched is in E1 and the month in E2.
To match dates anywhere in the month, you could use EOMONTH
=SUMIFS($B$2:$B$8,$A$2:$A$8,$E1,$C$2:$C$8,">="&DATEVALUE(E2&"-16"),$C$2:$C$8,"<="&EOMONTH(DATEVALUE(E2&"-16"),0))
Have changed first date in the screen shot below to illustrate the two formulae

Related

Dynamically sum cells whose neighboring cell contains certain text

In my spreadsheet, I am tallying expenses made by John, Bob, and Simon for a project.
When John records an expense, it must contain his name (not case sensitive):
A B
Apples(John) 50
Simon makes 90% of the expenses and doesn't always write his name down.
At the end of the project, an expense list might look like this:
A B
Apples(John) 50
Toy (bob) 15
Pencils John 30
Metal 10
Peaches (simon) 5
Donuts BOB 30
Without using macro's (which don't work on Android's Excel app), how can I dynamically sum their expenses as each new entry is entered?(I am logging expenses on the desktop and on the phone, synced through the cloud). I would like one cell for each team members total. This is tricky for me because I have to sum items in B if its corresponding entry in A contains a certain text. Something like:
Totals:
John 80
Simon 15
Bob 45
SUMIF() function will meet your requirement. You have to use wildcard in criteria part as names are mixed with item name. Try below formula.
=SUMIF($A$1:$A$6,"*" & D1 & "*",$B$1:$B$6)

Formula to find out how many times accounts transacted on the same day

I am looking for a way to find out which accounts appear to transact on the same days together the most.
I have looked into using the correlation function, but decided this would not provide the results I am looking for as I would need to be able to do this among the 6000+ different acct #s. Therefore, I have decided to try to solve this by creating a matrix of the account #s and finding out how many times each account transacted on the same day as another account, but I am open to other ideas of solving this if anyone has a better idea.
My source data is a large dataset consisting of 2 columns - Date (Column A) and Acct # (Column B).
I am currently looking into sum product, but since I do not want to look at any specific date, rather the date range as a whole, I am not getting what I want.
=sumproduct(('Trxs'!A:A='Trxs'!A:A)*('Trxs'!B:B=A$2)*('Trxs'!B:B=$a2))
What I am looking for would be a formula that I could use to pull across a matrix of the acct #s that would add up the number of times each of the 2 acct #s transacted on the same date over the time span of a month and not using a specific date to figure this out by.
1/1/2019 123456
1/1/2019 987654
1/2/2019 987654
1/3/2019 123456
1/3/2019 123456
1/3/2019 987654
1/3/2019 567890
and the outcome would be
123456 567890 987654
123456 3 1 2
567890 1 1 1
987654 2 1 3
I've came up with a solution using a helper table that counts if that account had activity that day:
The formula for the cell F12 on the helper table is:
=+IF(COUNTIFS($B$3:$B$12,$E12,$C$3:$C$12,F$11)>0,1,0)
And the formula on the Final Resul table:
Edit 2: I agree with Domenic, the formula on cell F4 works better with the IF section:
=IF($E4<>F$3,SUMPRODUCT(INDEX($F$12:$J$14,0,MATCH($E4,$F$11:$J$11)),INDEX($F$12:$J$14,0,MATCH(F$3,$F$11:$J$11))),COUNTIF($C$3:$C$12,$E4))

Sum product for all the months if 2 tables match

So I have this issue, I have two tables one is employees, and another one is the projects.
Employees Table:
Year Name Type Jan Feb
2018 Kevin Salary 5000 2000
2018 Kevin Insurance 200 400
2018 Alex Salary 3000 4000
2018 Alex Insurance 300 400
Projects Table
Year Project_Name Employee_Name Jan_Hours_Worked Feb_Hours_Worked
2018 Apple Alex 7 5
2018 Apple Kevin 5 0
2018 LG Kevin 0 3
Now I am creating a result list of all the projects and costs recurred for them, what I need is for each project in Table 2 to find which employees are involved and then use that to find related costs for the employee from the Table 1 and calculate total costs for that project.
(e.g for project LG, I have Kevin working on that in Feb,for him company paid 4400(salary+insurance) in Feb and the costs recurred for the LG project would be 4400 divided by hours spent on the project which Kevin in total spent 3 hours; e.g.2 for the project Apple it would be the same but sum of Kevin's and Alex's costs from Jan and Feb, so Kevin: 5200/5 + Alex:3300/7 + 4400/5)
Now I have the formula to calculate this for 1 months which is something like this
=SUMPRODUCT(SUMIFS(Employees[Jan], Employees[Name],Project[Employee_Name], Employees[Year], 2018 )/Project[Jan_Hours_Worked],--(Project[Project_Name]=K14))
I need to find how to get the yearly result per project without repeating the formula 12 times, also with this formula, i get div to 0 error when an employee didn't work on particular months, so that needs to be sorted somehow. Any Help?
I suggest you to change how you store your data. If you can make some minor changes, then you can have an easy way to get the information you want, and also a Pivot Table with a summary of cost recurred for each proyect and which employee generated that cost.
IMPORTANT: For this answer to work, you must make sure that every Employee's Name is UNIQUE. If not, adapt the example trying to create
an Employee's ID or something.
Also, please, note i got a spanish version of Excel, so screenshots are in spanish but I will translate formulas :)
Ok, first of all, I changed the design of your table Employees. Creating a column for each month is kind of annoying. Use just a column to get the month. You can type the month in a cell just like 01/2018 and Excel will change it instantly to format mmm-yy (Jan-18)
This is how your Employees table should look:
The column TOTAL COST is just a sum of SALARY + INSURANCE. If you have any other concept, just add it as a column and modify the TOTAL COST COLUMN to include it.
Second, the table Project, I think it should be like this:
The column Employee Cost has an Array Formula.
IMPORTANT: Array formulas are inserted pressing CTRL+SHIFT+ENTER
The formula is (I used same names for tables, so copy-pasting should work for you):
=INDEX(Employees;MATCH(Project[[#This row];[Employee_Name]]&Project[[#This row];[Month]];Employees[Name]&Employees[Month];0);COLUMN(Employees[[#Headers];[TOTAL COST]]))
If you typed the formula right, you should see { at start and } at end.
The formula in Cost Recurred to Project is just a division of Employee Cost / Hours. Added an IFERROR when the hours worked are 0, then show 0.
=IFERROR(Project[[#This row];[Employee Cost]]/Project[[#This row];[Hours]];0)
And last step, your Pivot Table. Create one and organise it to get the sum per hours and month and proyect you want. You can get one like the one below:
As you can see,e.g. for project Apple, you can see that total cost is 2.391,43
but also you can see the cost of each Employee. Pretty cool I think.
I really hope you can modify the design of your data, because Excel is designed to work going down (I mean using rows) more than using columns. Excel 2007 got more than 1 million of rows and just around 16.000 columns, so it's designed to work vertically.
Hope this helps, or at least, give to you a clue of how to proceed :)

How to: Aligning data on different time intervals in Excel

I'm looking to compare data that is from different time interval. I'm an Economics student and I'm trying to compare data that is released monthly and data that is released yearly. Specifically how the number of jobs created in a given month influences the GDP figure.
I'm neither allowed to post images or enough links with my current reputation so here's my beautiful collage to illustrate what I'm asking:
http://s22.postimg.org/jpspa1pvl/Screenshots.jpg
The frequency is different. The NFP (Jobs created) are released monthly, GDP is released yearly.
I'm wanting the GDP numbers to go at the start of the corresponding year. This is where I was having problems with VLOOKUP. I could't get it to align correctly or not repeat itself.
An illustration of the graph I'm after.
EDIT: To make it clearer
http://s15.postimg.org/qcg70u5aj/Screenshots1.jpg [ignore the graph]
Here's what I'm looking for without the dodgy formatting. So the first screenshot is the data. And the second is what I'm looking for.
The GDP data is released on the September each year, but it details the entire year of GDP growth. So I want compare it with the Job Figures (that are released monthly). So there will be 12 Job Figures (NFP) to each GDP figure.
Thanks.
PS: Sorry if there's similar questions. I don't know what keywords to search to get the answer.
I set up a sample worksheet as follows:
Column A, from Row 5 to 57 has dates: firsts of consecutive months 1/1/80, 2/1/80 etc
Column B, from Row 5 to 57 has random numbers for Non-Farm Payroll
Column D, from Row 5 to 17 has dates: Sep 30 of consecutive years 9/30/80, 9/30/81 etc
Column E, from Row 5 to 17 has random numbers for Annual GDP
Then I did this:
Column C, from Row 5 to 57: I added the formula =IF(AND(DAY(A5)=1,MONTH(A5)=1),VLOOKUP(DATE(YEAR(A5),9,30),$D$5:$E$17,2,FALSE),"")
Explanation
If the date in column A is the first of Jan (of any year), look up the 30th of Sep of same year in the GDP table and pick up the corresponding GDP value from the second column of that table ($D$5:$E$17). If not, leave the cell empty
Note
Once you have this modified to suit your purpose, you might want to copy those cells in Column C and do a paste-special (Alt-E, S) of them right back in the same place, pasting only the values so that the formulae are gone and you're not tied down to the GDP table.

Tallying dates and times in excel

Is there an easy way to tally a column formatted as follows: "5/24/2013 5:48:00 PM"
What I want to do is have it tally by day of week and an hour time block, the end result I'm looking for would look like the following:
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
1:00-2:00AM 10 2 8 7 3 12 15
2:00-3:00AM 5 4 7 7 9 11 18
et cetera. This is an extremely large data set so avoiding doing this by hand would be amazing. I apologize if this is a terrible question, I tried searching though other people's questions to no avail.
Not knowing the details, I would try to use a PivotTable.
There is the ability to group by dates; see this page for details (including a fancy animation).
Some additional searching should turn up a lot of resources on PivotTables; they are very powerful.
I'd assign a number to the rows/columns and then use sumif().
I would create add two columns: one with =Hour(A2), other with =WeekDay(A2) (example for row 2, assuming dates are on column A).
Then, use PivotTable on all data.
Regard formats: WeekDay must be formated as ddd or dddd and Hour as numeric.

Resources