Excel Sum Based on Several Criteria - excel

A B C
1 10/1/2009 3652449 12:15:43 AM
2 10/1/2009 3652449 12:17:03 AM
3 10/4/2009 3652449 1:03:08 AM
Hello,
I want to sum the total time of the card 3652449 just for 10/1/2009.
Then after the sum is compete I need the time to be converted and rounded into minutes only.
I have been using the following formula till now " =SUMIF(B:B,3652449,C:C) " and the result is " 1:35:54 ". But as I have written I want to sum the time for that card only on the date of 10/1/2009. When you copy the data in excel and you manually sum the time from 10/1/2009 you should get 32m & 46s. When you round it the result should be 32m.
I will be thankful for your help.

You should use a pivot table, which can easily give you the sum for every date in your table.
Pivot tables are supported in all good desktop spreadsheets, but not many online web-based ones.
See http://en.wikipedia.org/wiki/Pivot_table

I'm still not sure if I got you right.
If you want to add the date as condition, you can try something like that:
Add a formula to your column D: =B1&" "&A1
This should give you the following result:
A B C D
1 10/1/2009 3652449 12:15:43 AM 3652449 40087
2 10/1/2009 3652449 12:17:03 AM 3652449 40087
3 10/4/2009 3652449 1:03:08 AM 3652449 40090
Now you can change your original formula to: =SUMIF(D:D,"3652449 40087",C:C)
You can make column D invisible by either changing width to 0 or changing color to white.
Hope that is what you tried...

Related

How to sum up to reach a number by date in excel

I would like to make a formula that to do a sum calculation, that confirm which date to start (cell D5), then look for the start point from the row 1, and sum up the row 2 start from the correct date, and then stop the sum up if the amount is equal to or larger than run estimate (cell D6)
the steps should be like this:
I know the start day is 31-May
then I look into the table to find the date 31-May
then I look into the table again, find out the run estimate is 2 hours
I know I have 6 hours run estimate need to be completed
then I add 2 + 3 + 4 = 9 hours to cover the 6-hour estimate
then I know the end date is 2- Jun
I am able to find the start point on the table
=SUMIFS(B2:F2,B1:F1,">="&D5)
but I am not sure how to stop it
and moreover I am not sure how display the final value date, not the total amount..
col B col C col D col E col F
30-May 31-May 1-Jun 2-Jun 3-Jun
1 2 3 4 5
start date 31-May
run estimate 6
expected result should be 2-Jun
enter image description here
anyone can help on this?
Here is a solution that requires one extra row of data, to calculate the sum of run times up until that day: Put this formula in cells B3:F3 (or however many columns you have exactly)
=SUMIF($B1:B1,">="&$D6,$B2:B2)
Then you can find the first value that is equal to or higher than your estimate runtime and use that to offset to the correct date:
=OFFSET(B1,0,IFERROR(MATCH($D6,B3:F3,0)-1,MATCH($D6,B3:F3,1)))

count the total counts of cell per days

I am trying to find out the total number of order made in a day.
My data is like this :-
Date | Time | Product | Unit Sold
7/24/2018 10:45:59 Fries 1
7/24/2018 16:45:59 Fries 1
7/25/2018 12:45:59 Fries 1
7/25/2018 11:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
7/25/2018 1:45:59 Fries 1
Now here you can see the count of 7/24/2018 is 2 , 7/25/2018 is 4 ..
I can manually filter and select all column and just copy the count from bottom bar.
but the problem is I have calculate of about 3 months of about 10 different branches.
I did googled up and found out about COUNTIF . and here what I tried
=COUNTIFS(range,">="&date1,range,"<="&date2)
But it returns me #N/A
Can anyone help me on here?
What you are asking is very simple, and can done with a little focus.
Step 1: Make sure the dates in date column are in the same format as with your system date. If yes then move to step 2, if not, Select date column -> then goto Data tab in Excel ribbon -> Under data tools you will find Text to columns -> Click that and convert the Dates to your system date format. move to Step 2
Step 2:
The formuala you mentioned
=COUNTIFS(range,">="&date1,range,"<="&date2)
I am assuming is an example and real code should look something like this unless you are using Names for ranges
=COUNTIFS(A2:A7,">="&B9,A2:A7,"<="&B10)
OR a better version would be
=SUMIFS(D2:D7,A2:A7,">="&B9,A2:A7,"<="&B10)
since this formula will actually sum up the Unit Sold column instead of date column. Example attached in image below. Enjoy.
sumif and countif example image

SUMIF formula to find sum for dates today or earlier

so I have this table of salaries that I make (hypothetically):
A B C D
1 Date salary how_much_I_earned_so_far
2 total =SUM(salaries_until_today)
3 2017-10-1 5000
4 2017-11-1 5000
5 today-> 2017-12-1 5000
6 2018-01-1 5000
7 2018-02-1 5000
8 future.. 2018-03-1 5000
9 2018-04-1 5000
now I want to calculate on D2 the amount of money I have earned so far..
to do that, I want to sum up all the past salaries from C3 all the way down to C_x where x is the index of the line where today < B_x
so that raised me two questions
1) how do I select unknown index of cell? usually when I do formulas it looks like this =SUM(C2:C9) so how can I make the number 9 be variable?
2) can I create variable that depends on a number of lines of where a cell is smaller than a value? I know how to get the current day, its simply =TODAY() but now I want to compare it with all B's and find the index of line where its smaller than it.. how do I start?
I'm sorry if that's a weird question, I'm a programmer and its frustrating me that a simple thing that I could quickly solve by code cannot be accomplished in a sophisticated app such excel..
thanks.
=SUMIF(B:B,"<=" & TODAY(),C:C)

Excel - Include Row in Sum Based on Comparison to Following Row

Paging All Excel Wizards,
I am trying to see if there is a way to have a one-line SUMIF or something similar to sum up the following criteria in an Excel spreadsheet:
Sum the values of Column C if
If Column A = "Chizzle"
AND If Column B is >= Column B of the next row
Sample Data:
A B C
Type Level Value
__________________
Chizzle 1 23
Chizzle 2 10
Bobbles 3 1.5
Bobbles 3 2.6
Chizzle 2 5.5 <- Should Be counted
Cobbles 2 1
Chizzle 1 3.3 <- Should Be counted
I have tried using something like this:
=SUMIFS(C1:C1000,A1:A1000,"Chizzle", B1:B1000, ">=" & B2:B1001 )
Unfortunately the B2:B1001 part isn't working and it is selecting all values.
If there is a way to do this with a one line calculation, without having to add an additional column? That would be awesome but I'm not sure if it is possible.
Thanks!
Try this SUMPRODUCT():
=SUMPRODUCT(($A$2:$A$8="Chizzle")*($B$2:$B$8>=$B$3:$B$9)*($C$2:$C$8))

How to sum the number of overlapping time frames in excel

Hoping someone can help,
I work for a fire department and i am trying to determine the number of times all our rigs on the road at emergencies at the same time. I have all the data from date, times, etc... So what i am looking for is an excel summation total that would display the sum of overlapping times that were greater than 3. So kinda as follows:
Rig Date Start Time End Time
1 1/1/2015 0703 0759
2 1/1/2015 0705 0823
3 1/1/2015 0706 0815
4 1/1/2015 0723 0759
1 1/1/2015 0802 0845
With more than three rigs on the road after 0723 it would grant me a total of one but then at 0802 rig 1 goes back out again meaning my total would increase by 2 and so on and so on. I dont have the slightest clue as to how to program this. I have three years of data i need to crunch through and something like this would help me greatly. Any help whatsoever is appreciated. Thanks in advance and lets see what you all come up with!
First, you might want to convert the times to Excel date-times (assuming you already applied Format as Table to your data, so all new formulas get populated for all rows automatically):
if the values are already Excel times, use:
=$B2 + C2
if you have integers like "703" (formatted as "0703"), use:
=$B2 + INT(C2/100)/24 + MOD(C2, 100)/24/60
or if you have values-as-text:
=$B2 + LEFT(C2, 2)/24 + RIGHT(C2, 2)/24/60
Don't forget to format the new columns using Custom Number format d.m. hh:ss or m/d hh:ss.
The next step is to count all ongoing deployments that end only after the current deployment started, i.e. use following formula as illustrated on screenshot:
=COUNTIFS(F$2:F2, ">" & E2)
Please make sure that the formula e.g. in row 13 looks like =COUNTIFS(F$2:F13, ">" & E13) to check that you are on the right track. Also none of the values can be 5 or more if you only have 4 rigs, otherwise you have an error in your data.
And to count number of times when all 4 rigs were in use, the formula looks like this:
=COUNTIFS($G$2:$G$13, 4)
In case you also want to sum the time while none rigs were available, add 2 more columns in your table. Column H in my illustration needs following array formula (entered by Ctrl+Shift+Enter):
=IF(G2=4, MIN(IF(F$2:F2 > E2, F$2:F2)), "")
And a normal formula in column I:
=IF(G2=4, H2-E2, "")
Don't forget to format numbers accordingly.
And do a simple sum: =SUM($I$2:$I$13).

Resources