Calculate 3 month Average on the base of CustomerID - excel

I am trying to calculate three month average sales in excel w.r.t customerid in excel. I tried by doing it by AverageIfs function but nothing helped.
A B C
Orderdate sales customerid
5/15/2019 7 1
5/15/2019 48.5 1
4/15/2019 92.94 1
3/17/2019 102.85 1
3/18/2019 49 1
3/18/2019 119.95 1
2/18/2019 58.96 1
1/20/2019 14.6 1
5/16/2019 17 6
4/15/2019 148.5 6
4/12/2019 912.94 6
3/17/2019 102.85 6
9/18/2018 22.34 6
Formula I tried: =AVERAGEIFS(B:B,C:C,C2)
output expected:
customerid average(3 months)
1 49.48
6 359.48

Let's start from today's date and the date 3 months ago (Make it dynamic):
Remember to change the cell format from General to Date. Otherwise, it will show [43563]
Next use the date as part of our filter:
Now you should get the most recent 3 months data:
Copy the filtered data into a new spreadsheet
Copy the filtered data into a new spreadsheet
Copy the filtered data into a new spreadsheet
Next Step: get the distinct customer ID:
You will get this:
Last Step:
Use the function "AVERAGEIF":
Done!

Related

Excel formula help - I have 14/28 day readings averaged per day which need to be recorded as daily readings

Dates when the data was read are shown on the date column on the left, then worked out a value per day shown in ET/DAY column.
To analyze monthly data etc etc I want daily data so every day has the ET/DAY value between the dates it was read and inserted in the et/day column.
I have entered in manually what I want in blue but need a formula to do this as too long to do all manually
You can do this with MATCH. With an ascending list, if you give the magic number 1 as the third parameter, it will show the last row number with a smaller or equal number.
Here it's matched 17 with 15 in column A and the result is 2, for row 2:
A
B
C
1
10
=MATCH(17,A:A,1) = 2
2
15
3
20
So for your data, you can match the daily dates with the column on the left, and feed the row number into INDEX to look up from the ET/Day column.
A
B
C
D
E
1
Date
ET/Day
Daily
ET/Day
2
05/Jan/1995
05/Jan/1995
=Index(B:B, Match(#D:D,A:A,1)) = #N/A
3
19/Jan/1995
3.00
06/Jan/1995
=Index(B:B, Match(#D:D,A:A,1)) = 3.00
4
02/Feb/1995
5.41
07/Jan/1995
=Index(B:B, Match(#D:D,A:A,1)) = 3.00
5
...
...
6
19/Jan/1995
=Index(B:B, Match(#D:D,A:A,1)) = 3.00
7
20/Jan/1995
=Index(B:B, Match(#D:D,A:A,1)) = 5.41
There's an inconsistency here with the 05 Jan rate but it should be good after that.

In Excel how do I find a column then sum between two dates?

In excel I have a pivottable:
Project
11/1/2021
11/2/2021
11/3/2021
Dept 1
5
5
5
Dept 2
2
5
5
Dept 3
5
4
6
Dept 4
5
3
5
The table spans the full length of the month. I need a calculation that would find the department I input then sums all figures between today's date and the last day of the month:
Dept
Total
Dept 1
15
I have tried
=SUMPRODUCT(((Today()<=B1:K1)*(EOMONTH(TODAY(),0)>=B1:K1))*(A2:A5="Dept 1")*(B2:K5)
and various different vlookups but I can't figure out how to both find the correct row and then sum everything between the two dates in that row.
Assuming the following structure:
Try this, it works:
SUM(INDIRECT(ADDRESS(MATCH($B$2,$A:$A,0),COLUMN($B$6))&":"&ADDRESS(MATCH($B$2,$A:$A,0),MATCH($B$3,$6:$6,0)),TRUE))

Excel function to return in a date based on value

I have this data in excel.
Code Duration Months
1 AC-26482-17 8
2 AC-26482-18 10
3
How can i return a start and expiration date like in this table? The last 2 digits of my code is always the starting year (01/01/....).
Code Duration Months Start Expiration
1 AC-26482-17 8 01/01/2017 01/08/2017
2 AC-26482-18 10 01/01/2018 01/10/2018
3
For your "Start" column you can do:
="01/01/"&RIGHT(A3,2)
For your "Expiration" column you can do:
=IF(LEN(B3)=1,"01/0"&B3&"/"&RIGHT(A3,2),"01/"&B3&"/"&RIGHT(A3,2))
In C2, formula copied down :
=0+("1/"&RIGHT(A2,2))
In D2, formula copied down :
=EDATE(C2,B2-1)

FCR calculations in excel

I am trying to work the (First Contact Resolution) FCR in excel however so success.
Does anyone know an automated formula used in excel?
We have been trying to use formulas to check how many times a customer with the same customer ID calls us in 7 days.
Assuming your requirement
ID Date Calls Count in last 7 days from today
1 13-Mar-17 2
2 14-Mar-17 0
5 15-Mar-17 1
1 16-Mar-17 2
3 17-Mar-17 1
5 18-Mar-17 1
7 19-Mar-17 1
9 20-Mar-17 1
1 21-Mar-17 2
13 22-Mar-17 1
2 23-Mar-17 0
17 24-Mar-17 0
5 25-Mar-17 1
21 26-Mar-17 0
Putting ID in Column A and Dates in Column B and records starts from row 2
put this formula in Cell "C2":
=COUNTIFS(A:A,A2,B:B,">="&TODAY()-6,B:B,"<="&TODAY())
and drag it all way down to see the number of calls
or put this formula if you want to calculate last 7 days from the date in sheet:
=COUNTIFS(A:A,A2,B:B,">="&B2-6,B:B,"<="&B2)
Please let me know if you meant something else as I tried my best to assume the senario.

How to find values in one column in another column with multiple values

I have an excel like
A B START DATE END DATE
1 10 01-jan-2016 02-jan-2016
2 11 01- jan-2051 02-feb-2061
3 1 04-mar-2016 07-mar-2016
4 1 08-mar-2016 10-mar-2016
5 5 01-mar-2016 03-dec-2016
6 5 03-nov-2016 31-dec-4712
I am new to excel. I want to highlight or extract the columns in A column which can be found in B Column along with the start date and end date .
That is result should be like :
A start_date end_date
1 04-mar-2016 07-mar-2016
1 08-mar-2016 10-mar-2016
5 01-mar-2016 03-dec-2016
5 03-nov-2016 31-dec-4712
Can anyone pls suggest something ?
In E2 enter:
=IF(COUNTIF(A:A,B2)>0,"X","")
and copy down. Then filter the table
You can hide any un-wanted columns after that.

Resources