How to Drag a formula in Excel both across the columns and rows? - excel

I have an Excel 2007 file with 2 sheets. The first sheet has 2 columns: one of dates, one of numbers like so:
1/1/2017 37
1/2/2017 82
1/3/2017 96
...
The second sheet has is to store the numbers in a "Calendar-like" fashion, like so:
SUN MON TUE WED THR FRI SAT
1/1/2017-1/7/2017 37 82 96 23 54 25 97
1/8/2017-1/14/2017 49 76 65 13 12 14 96
...
I am filling the "Calendar" style sheet from the much larger "List" style sheet. These go on for years, so I need a simple way to fill the "Calendar" style sheet from the plain list. I can use the simple formula of =sheet1!D7 to get from one sheet to the other, but I can only drag that formula in one direction... I can start it on Sunday, Jan 1 and drag it the whole way to Saturday, Jan 7, but if I try to drag the formula from that row to the next, it tries to insert starting with Jan 2 instead of Jan 8:
SUN MON TUE WED THR FRI SAT
1/1/2017-1/7/2017 37 82 96 23 54 25 97
1/8/2017-1/14/2017 82 96 23 54 25 97 61
...
Can I get these values from the list-type sheet to the calendar-type sheet without typing the formula in for each and every cell?

Not sure how your data is laid out, but if you adjust the range, this index/match should work:
=INDEX($B$1:$B$31,MATCH(DATEVALUE(LEFT($E3,SEARCH("-",$E3)-1))+COLUMN()-6,$A$1:$A$31,FALSE))
Note: I have one magic number in the formula, a 6. This is because this is where your "Sun" column starts. If you put your formula in any other column, adjust that number. Alternatively, you could get fancy and add logic looking for "Sun" in some array, but thought that's a little overkill.
You can drag this formula over and down.

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

How to calculate averages IDs in 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]

How to add cells consecutively after an interval of three cells

I have 18 years of monthly data i.e., I have 18*12 = 216 cells arranged in a row. I have to add JJAS (June 01 July 01 August 01 September 01) and then ONDJF (Oct 01 Nov 01 Dec 01 Jan 02 Feb 02) values. I want to skip MAM. I have to repeat this procedure for all 18 years.
I can do this manually but want to automate it.
I want JJAS 01 ONDJF 01-02 JJAS 02 ONDJF 02-03...
If Column B contains dates and Column C contains text then putting this formula in Column A will result in Column A having text for JJASONDJF and empty cells MAM.
=IF(OR(MONTH(B1)<3,MONTH(B1)>5),C1,"")
If dates are in Row 2 then putting this formula in Row 1 will display the date.
=IF(OR(MONTH(A2)<3,MONTH(A2)>5),A2,"")

Output range of cell value in excel

I need to compute the range of a given cell in excel. For example, if the cell is like below,
Val
---
25
23
18
52
66
I need a formula to just find which range it belongs to. the ranges can be in intervals of 5 .. like 0-5,5-10,10-15 and so on. So desired output is
Val Range
-------------
25 21-25
23 21-25
18 16-20
52 51-55
66 66-70
Assuming A1 holds the value 25, then put this formula in A2:
=TEXT(CEILING(A1/5,1)*5-4,"0")&" - "&TEXT(CEILING(A1/5,1)*5,"0")
Copy it down to other rows as required

How can I perform functions on a specified subset of rows?

I want to find the max (min, average, etc.) of a column but only for the subset of rows where another column matches a certain pattern.
For example, here is the data in the sheet named "data":
Date Value
Jan 15
Jan 17
Jan 3
Feb 19
Feb 34
Feb 37
Then in a separate sheet, "reports", I'd like to have:
Jan Feb
Max 17 37
Min 3 19
What function I can put in the cells in the "reports" sheet to get those values?
If it matters, I'm using Gnumeric 1.10.
To achieve:
=max(column b where column a == Jan)
You can use an IF to do that:
=MAX(IF(A2:A7="Jan", B2:B7))
This formula should be entered as an array formula however. In excel, you do this with Ctrl+Shift+Enter.

Resources