Excel sumif function with conditions - excel

I need to sum a column with alot of variables and i am having trouble when making it. ( see picture for reference)
I need to sum G (Sum time) if its less than 300 (<300), if B (Type) =1, if D (date) = input cell and if E( time) = a certain range that i can change, for example "7pm -12pm"
I don't have a ton of experaicen with having these conditions, this is what i have tried so far.
sumif(Table1[[ type]]=1, IF(Table1[[#All],[Date]]=K3, AND(Table1[[#All],[Time]]=K4, IF(Table1[[#All],[Sum Time (sec)]]=<300))))
Any help would be greatly appreciated
Picture here :

Try SUMIFS
=sumifs(table1[sum time (sec)],Table1[type],1, Table1[Date],K3, Table1[Time],K4, Table1[Sum Time (sec)],"<300")

Related

If statment in Excel

Hy! Could someone help me out with this equation ? I looked onlyne for some solution but nothing could work :/
I am trying to figure it out how to calculate the following:
if anexe ( temporary higher work hours ) is greater then the contract hours, are equal to anex - worker hours( which i called uren )
I want so calculate a if statement more or less like this:
If Anexe > contract, is equal to Anex - uren
else Anexe < contract then contract - uren
Thank you for helping out already!
Above is a sample copy of your table with some random values between 0 and 100 filled in. I think the formula you want in cell D2 is:
=IF(C2>A2,C2-B2, IF(C2<=A2,A2-B2,0))
You can then copy it down to the cells below.

Incorrect result for nested condition in MEDIAN-IF excel

I have a following excel spreadsheet which consist of following fields:
Col A: Timestamp
Col B: Numerical result
Col C: Time duration taken for calculation of result
Now, I'm trying to find the median value of col C (Duration) for various month and year combinations.
e.g. For the month of march in 2019, what's the median value of duration?
I could've used the MEDIANIFS, but sadly it didn't exists. I'm trying the below thing also, but it's not giving the correct result(G1 is a drop-down which consists numerical valued years i.e. 2019, 2020 and so on)
MEDIAN(IF(YEAR(A3:A100) = G1, IF(MONTH(A3:A100) = 3, C3:C100)))
I also tried ANDing the conditions but it also didn't worked:
MEDIAN(IF((YEAR(A3:A100) = G1) * (MONTH(A3:A100) = 3), C3:C100))
If I put one condition inside the Median(If()), it's working fine. But, whenever I nest or concat conditions, it's not giving the correct result.
Any help/pointers will be highly appreciated.

How to define an array of numbers with a formula

I have a project where I need to break people into 3 buckets with task lists that rotate quarterly (Phase A = task list 1, B = task list 2, C = task list 3). The goal here is to sort people into the buckets based on a departure date, with the ideal being that they would depart when they're in the C phase. I have a formula already set up that will tell me the number of quarters between the project start date and the person's departure date, so now I'm trying to figure out how to get Excel to tell me if a person's departure date falls within their bucket's C Phase.
I have this formula in a column called DEROSQtr:=ROUNDDOWN(DAYS360("1-Oct-2020",[#DEROS],FALSE)/90,0)
Now the easy way to approach this would be to build a static array and just see if that formula results in a value in the right array, where the numbers in the array define which quarter from Oct 2020 that the bucket's C Phase is going to be in:
ArrayA = {1;4;7;10;13;16} ArrayB = {2;5;8;11;14;17} ArrayC = {0;3;6;9;12;15}
The formula that pulls this all together is then:
=IF([#EFP]="A",IF(IFNA(MATCH([#DEROSQtr],ArrayA,0),-1)<>-1,TRUE,FALSE),IF([#EFP]="B",IF(IFNA(MATCH([#DEROSQtr],ArrayB,0),-1)<>-1,TRUE,FALSE),IF([#EFP]="C",IF(IFNA(MATCH([#DEROSQtr],ArrayC,0),-1)<>-1,TRUE,FALSE),"-")))
Now while this will work for as long as I build out the static array, I'm trying to figure out how to define each of these buckets with a formula that Excel can work with, i.e. bucket A hits phase C in 3n + 1 quarters where n is the number of cycles through all 3 phases, so ArrayA = 3n+1, ArrayB = 3n+2 and ArrayC = 3n. What I'm hunting for here is the best way to define each of the arrays as a formula.
After some additional digging and looking back at how to define each array, I came across the MOD() function in Excel. I was then able to rewrite the formula that does the checking as =IF([#EFP]="A",IF(MOD([#DEROSQtr]-1,3)=0,TRUE,FALSE),IF([#EFP]="B",IF(MOD([#DEROSQtr]-2,3)=0,TRUE,FALSE),IF([#EFP]="C",IF(MOD([#DEROSQtr],3)=0,TRUE,FALSE),"-"))), replacing ArrayA(3n+1) with MOD([#DEROSQtr]-1,3), ArrayB(3n+2) with MOD([#DEROSQtr]-2,3), and ArrayC(3n) with MOD([#DEROSQtr],3).
Since I do not have the data you are calculating your quarter, its difficult to give you exact answer. However, as I understand your have a column which has the formula to calculate the quarter say "Formula_Col"
Solution will be to add a new column and flag it based on the values in "Formula_Col".
If you can give some sample data I can provide exact answer.

Excel: Calculate average time (duration), with criteria, between 2 columns

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

Excel - MAX and MIN value by month for a certain item

Can someone help me out with a formula?
I have a large database and I`m trying to figure out, how to get the MAX amount used in January 2017 for a product X.
I have found the averages using - AVERAGEIFS(Avg.de.time!E3:E80231;Avg.de.time!A3:A80231;C2;Avg.de.time!C3:C80231;">="&H7;Avg.de.time!C3:C80231;"<="&EOMONTH(H7;0))
Column A - Item no.
Column B - Supplier name
Column C - Order date
Column D - Receive date
Column E - Delivery time (D-C)
I`ve spent too many hours on trying to figure this out.
So I m asking for Help :)
Using array formulae you can rewrite your AVERAGEIFS statement using a conditional array expression as follows:
=AVERAGE(
IF(
(
(Avg.de.time!A3:A80231 = C2) *
(Avg.de.time!C3:C80231 >= H7) *
(Avg.de.time!C3:C80231 <= EOMONTH(H7,0))
) > 0,
Avg.de.time!E3:E80231
)
)
I've just formatted the code to make it easier to see where each of the criteria, criteria_ranges and value_range appear however this will obviously be one long line in your cell.
It's now very simple to swap out AVERAGE at the start with MAX, MIN or another aggregate function with the rest of the formula remaining identical.
=MAX(
IF(
(
(Avg.de.time!A3:A80231 = C2) *
(Avg.de.time!C3:C80231 >= H7) *
(Avg.de.time!C3:C80231 <= EOMONTH(H7,0))
) > 0,
Avg.de.time!E3:E80231
)
)
As this is an array formula, you will need to type it into your Excel cell and hit Ctrl-Enter to make it an array formula. You can check this worked as curly braces {} will appear around the formula.

Resources