How to calculate averages IDs in Excel - excel

I have the following data
A B
ID Time
22 00:20
33 00:30
60 01:30
41 00:20
41 00:30
33 01:00
22 01:00
Column A= Id and column B= Time
I want to calculate the average time for IDs and get the following table in Excel
I struggled to do it
C D
ID Time
22 40
33 45
60 90
41 25

Make sure you are using the right formula and have the number format as general.

If you have the unique IDs in column C, and want the average on column D, and row 1 has the titles, you could use this formula in cell D2:
=averageifs(b$1:b$1000, a$1:a$1000, d2)
It means "Average the number in column B if what is in column A matches D2".
Fill down the formula.
Then select column D, press Ctrl-1 (with the numbers on top of the letters) to go to format, and in "General" type [mm].

AVERAGEIF is enough:
=AVERAGEIF(A:A;D2;B:B)
Cell format [mm]

Related

Excel - identify due date based on multiple frequencies of given dates

I have table of frequency with amount:
name start_date end_date frequency(M) Amount
A 11 Nov 22 11 Nov 23 6 220
B 15 Nov 22 23 Jun 23 3 500
and a date table. Is there anyway using Excel formulas to identify due dates of these frequencies and sum up all due amounts, like:
Date Amount
10 May 23 0
11 May 23 220
12 May 23 0
13 May 23 0
14 May 23 0
15 May 23 500
Thank you very much.
u can calculate the dates in the same row. the first date calculated would be referring to the start date and every subsequent dates to be calculated would be based on the previous date calculated
so, if your above first table is put in cells from A1 to E3,
the formula in cell F2 should read as: =IFERROR(IF(EDATE($B2,$D2)>$C2,"",EDATE($B2,$D2)),"")
and formula in cell G2 should be: =IFERROR(IF(EDATE(F2,$D2)>$C2,"",EDATE(F2,$D2)),"")
you will next need to pull formula in cell G2 towards right
and copy and paste formula in row 2 in row 3 onwards
to get sum of all the due amount you may next do a sumproduct function of the dates in formula and the amount column

I need get output using excel formulas

I want to get output on below table using Excel function.
I have tried Index match but it only helps to get output for first value, while I have duplicate values.
Database
Date Product Name
01-01-2016 60 A
01-01-2016 54 B
01-01-2016 40 C
01-01-2016 60 D
01-03-2016 47 A
01-03-2016 39 B
01-03-2016 46 C
01-03-2016 42 D
01-02-2016 37 A
01-02-2016 53 B
01-02-2016 25 C
01-02-2016 46 D
01-04-2016 49 A
01-04-2016 47 B
01-04-2016 46 C
01-04-2016 27 D
Need a help to fill the below table using Excel formula
Kindly find the below sample output
enter image description here
Using your posted "database" graph (the first one) as a reference and assuming that it starts in cell A1, I put your "required output" data in F1:J5. "A" starts in F2, F1 is blank and the dates are in cells G1:J1.
In G2 put this Array formula and then fill down to the last letter "D": = INDEX($B$1:$B$17,SMALL(IF($C$2:$C$17=$F2,ROW($C$2:$C$17),""),COLUMN()-6)). Then fill across. The "COLUMN()-6" in the Small function assumes that you put your "required out" data in the range F1:J5; otherwise, you will need to change it manually.

Excel Sumifs Index Match returning only value

Trying to use a combination of SUMIFS, INDEX and MATCH but the formula only returns a value from the first column and ignores subsequent columns which share the same field. What formula can I use to overcome this issue please?
A B C D E F
1 Name Week1 Week1 Week2 Week2 Year
2 CustomerA 10 20 30 40 2019
3 CustomerB 50 60 70 80 2019
4 CustomerA 90 100 110 120 2018
5 CustomerB 130 140 150 160 2018
I have to get the Week 1 Total for Customer A in 2019.
I tried using this formula:
=SUMIFS(INDEX(B:E,0,MATCH("Week1",B1:E1,0)), A:A,"CustomerA", F:F, "2019")
The formula however, only returns $10 for Customer A in Week 1 in 2019 instead of $30 ($10 from Cell B2 + $20 from cell C2). This means it matches the Week 1 field in column B and ignores the Week 1 field in column C.
What amendment do I need to make to the formula to overcome this problem please?
Thanks.
That method will only work if the values are unique, as it will only return the first column where a match is found.
You will need SUMPRODUCT:
=SUMPRODUCT(($B$1:$E$1="Week1")*($A$2:$A$5 = "CustomerA")*($F$2:$F$5 = 2019)*($B$2:$E$5))

Combining Data from two columns in excel, alternate rows

I have two columns A and B
**A**
30
40
50
60
70
**B**
90
80
10
20
I am struggling to find a formula that will allow me to combine the two columns by taking first value of column A followed by two values of column B and so on:
Combined Column "C" Example:
**C**
30
90
80
40
10
20
and so on.
What can I do? Thanks
If your data starts from row 1, you can type the following formula in column C:
=IF(MOD(ROW(),3)=1,INDIRECT("A"&TEXT(ROUNDUP(ROW()/3,0),"0")),IF(MOD(ROW(),3)=2,INDIRECT("B"&TEXT(ROUNDUP(ROW()/3,0)*2-1,"0")),INDIRECT("B"&TEXT(ROUNDUP(ROW()/3,0)*2,"0"))))
If the data starts from row 2, then the formula is:
=IF(MOD(ROW(),3)=2,INDIRECT("A"&TEXT(ROUNDUP(ROW()/3,0)+1,"0")),IF(MOD(ROW(),3)=0,INDIRECT("B"&TEXT(ROUNDUP(ROW()/3,0)*2,"0")),INDIRECT("B"&TEXT(ROUNDUP(ROW()/3,0)*2-1,"0"))))

Find column and row name based on search criteria

I have the following Excel spreadsheet:
A B C D E F G
1 Q1 Q2 Q3 Q4 Search criteria: 60
2 Asset 1 15 85 90 70 Column name: Q4
3 Asset 2 40 80 45 60 Row name: Asset 2
4 Asset 3 30 50 55 10
5
In Cells A1:E4 I have different assets with their performance from quarter Q1-Q4.
In Cell G2 and G3 I want that the assets and the quarter are displayed based on the value that is put in Cell G1. In this case the search criteria is 60 so the result is column name Q4 and row name Asset 2.
With VLOOKUP or INDEX & MATCH I would only be able to find the the value 60 based on the criterias in Cell G2 and G3 but not the other way around like I need it.
Do you have any idea of a formula that could solve this issue?
NOTE: All values in the table are unique.
You could use something like this (entered as array formulas using Ctrl+Shift+Enter)
Try the following...
G2:
=INDEX(B1:E1,MATCH(G1,INDEX(B2:E4,MATCH(G3,A2:A4,0),0),0))
G3, confirmed with CONTROL+SHIFT+ENTER:
=INDEX(A2:A4,SMALL(IF(B2:E4=G1,ROW(A2:A4)-ROW(A2)+1),1))

Resources