Hi I have data inside 3 columns:
A. Destination (es. LosAngeles)
B. Carrier (es. Ups)
C. Shipment Time (es. 4:00)
The time used is the 24h time without Am/Pm
I need to do a countif to know how many shipments we have at a specific time.
Tried with:
=COUNTIF(A1:A100,">="&TIME(8,30,0))-COUNTIF(A1:A100,">"&TIME(9,0,0)
Result 0
Tried with:
=COUNTIFS(A1:A100,">=8:30",A1:A100,"<=9:00")
Result 0
Tried with:
=COUNTIF('sheet1'!I:I,"<="&TIME(4, 0, 0))
Result 0
Any help?
Thank you in advance.
Try:
=COUNTIFS(A1:A100,">="&TIME(8,30,0),A1:A100,"<="&TIME(9,0,0))
The formula below was missing a closing bracket at the end
=COUNTIF(A1:A100,">="&TIME(8,30,0))-COUNTIF(A1:A100,">"&TIME(9,0,0))
Related
I can't obtain the average time from start to end of some activities,
I tried 1K way but the result isn't correct, every time I've one day minus.
the image can explain better (that my english).
In this example the sum of my activities il 480:52:56 hours, in vba I've different result, for vba the date is "19/01/1900 00:52:56" like 456:52:56 hous
24 hours minus
why this difference? and how I can obtain the same result?
thanks for any suggestion
Dates are stored as serial numbers where first valid date has a value of 1. This value in excel reads as 01/01/1900, and in VBA as 31/12/1899. In excel, value 60 returns 29/02/1900 which doesn't exist in VBA, so from value 61 onwards all values will return the same date in VBA and excel.
/e: Also, maximum value is 2958465 (31/12/9999), values higher than that will return error rather than valid date
thanks to your comments I understand that the problem is for the minor dates of March 1, 1900 so I changed the select from:
Select [DataAttesa] as Data, avg(iif([totHours] > 1 and [totHours] < 61, dateadd("d",-1,CDate([totHours])) , [totHours])) as nr FROM [db_In$] Where TypeTrasp = "AOG" group by [DataAttesa] Order by [DataAttesa]asc
now, when I put the recordset.results on excel the value are correct.
Thank at all
Breaking my head over this, time to look for help :(
I have a sheet with raw data, as illustrated below.
I'd like to calculate the average duration per TestName (column A) between the 2 timestamps (B and C) in another sheet.
How can I do this in 1 formula?
Note 1: The correct answer is (done manually)
test1 = 26:41:23
test2 = 08:23:10
Note 2: 1 formula please, without adding extra columns to calculate the duration per each first
Note 3: I cannot change the format of the raw data
Note 4: ignore empty fields
Thank you!
Use a new Column D to calculate the difference between start and end date on each row:
=DATEVALUE(C2)+TIMEVALUE(C2) - (DATEVALUE(B2)+TIMEVALUE(B2))
Next calculate the average on test1 and test2
=AVERAGEIFS($D:$D, $A:$A, "test1")
=AVERAGEIFS($D:$D, $A:$A, "test2")
Note that I'm using a comma as separator, in some languages, other separators, like semicolon are needed to write the formulas properly.
Now format the view to display at least the days in addition to the time: "DD - hh:mm:ss". Going beyond 31 days is a bit difficult as the month will count up.
If you don't like the formatting, go with the raw number format and extract the information through a bit of math. If it shows for example 1,5 it means one and a half days. I hope you can handle converting decimals to hours, minutes and seconds. MOD(ulo) and Rounddown are going to be your friends. :-)
I have this table in excel:
Date value
1/2/1970 100.00
1/5/1970 99.99
1/6/1970 100.37
1/7/1970 100.74
1/8/1970 101.26
1/9/1970 100.74
1/12/1970 100.79
1/13/1970 101.27
1/14/1970 101.95
1/15/1970 101.97
1/16/1970 101.76
1/19/1970 102.21
1/20/1970 102.70
1/21/1970 102.00
1/22/1970 101.46
1/23/1970 101.49
1/26/1970 100.97
1/27/1970 101.45
1/28/1970 101.70
1/29/1970 102.08
1/30/1970 102.19
2/2/1970 102.02
2/3/1970 101.85
These are values that I have daily, and I need to construct a sheet that takes a monthly index of the daily values, example below:
date index
1/31/1970 some_index
2/28/1970 some_index
3/31/1970 some_index
4/30/1970 some_index
I could only get this far when it came to getting the index of 30 days:
=AVERAGE(INDEX(B:B,1+30*(ROW()-ROW($C$1))):INDEX(B:B,30*(ROW()-ROW($C$1)+1)))
I'm just not sure how to structure this in the most efficient, yet correct way possible. Not all months are the same amount of days, so I was hoping to check to get all the next n rows where the date starts with a "1" for example, sometimes certain days are also missing. I can't think of a catch all approach.
With 1/31/1970 in C1 try this,
=averageifs(daily!b:b, daily!a:a, "<="&c1, daily!a:a, ">="&eomonth(c1, -1)+1)
A PivotTable might be more convenient:
I have the following data sheet:
As you can see I have a date and a no which is a string.
Now I want to filter out all dates which have the same number in a +-20 day intervall around the date. So for example:
If the 12.2.2014 has the value a then it gets a 1 and if the 3.2.2014 has the value a it gets also a 1. In contrast if the value 15.1.2014 has the value a it gets a 0 because it is not in the +-20 day range. If there exists two rows like in the example below with 10.07.2002 and value d then it gets a 0 because there is no other day in a 20 day intervall around it.
My implementation idea is: Calculate for each value and date the difference of the dates and if it is less or equal than 20 and greater and equal to 1 then give out a 1 else a 0.
Can this be done in excel?
I really appreciate any suggestions
PS.: I hope that I showed the problem clearly!
UPDATE
Using this formula I get:
=COUNTIFS($B$2:$B$32;B2;$A$2:$A$32;">"&(A2-20);$A$2:$A$32;"<"&(A2+20))-1
see col E.
Something like this (adjust the $B$2:$B$32 etc to your actual data range):
=COUNTIFS($B$2:$B$32,B2,
$A$2:$A$32,">" & (A2-20),
$A$2:$A$32,"<" & (A2+20))-1
-1 is to avoid counting the row the formula is on.
To give only 0 or 1:
=MIN(COUNTIFS($B$2:$B$32,B2,
$A$2:$A$32,">" & (A2-20),
$A$2:$A$32,"<" & (A2+20))-1,1)
I am trying to compare the date of my Last B Service + Service interval months to todays date in Sharepoint. But it is giving me an error.
=IF(DATE(YEAR([Last B Service]),
MONTH([Last B Service])+[B Service Monthly Interval],
DAY([Last B Service])),"D")) >= NOW(), 0, 1)
I add B Service Monthly Interval to the Months section in the Date variable, then try and compare it to NOW() (todays date) to make this example easier, i have changed the result to 0 and 1 (i ahve also tested this and it returns an error)
Can you see whats wrong with that code?
I don't know what the "D" is doing in your formula as all the parentheses around that area make the formula invalid (you actually tried to close the IF after "D".
I don't know if it makes sense, but the following formula would work:
=IF(DATE(YEAR([Last B Service]);MONTH([Last B Service])+[B Service Monthly Interval];DAY([Last B Service])) >= NOW();0;1)
Here comes the trick: SharePoint calculated columns formula are largely compatible to Excel! What I actually did to try this out:
Open a new sheet
Write "4/14/13" into A1 (the last service)
Write "3" into B2 (the service interval)
Create the formula in C3: =IF(DATE(YEAR(A1);MONTH(A1)+B1;DAY(A1)) >= NOW();0;1)
Profit