Referencing a sheet based on cell value - excel-formula

I have an excel workbook with sheet tabs for data collected each month like "Nov 2016", "Dec 2016" and so on.
I have "Report" sheet tab that analyzes the data from the data sheet Nov 2016 with formulas referencing "Nov 2016" and the cells therein for data.
I would like to be able to analyze data from "Dec 2016" if I change the cell A1 on "Report" to "Dec 2016".
What formula can I use to do this and to reference the data based on the month selected in "Report"? eg ='Nov 2016'!AN19 should change to ='Dec 2016'!AN19 if Dec 2016 is typed in cell A1.
Thankyou.

Put your sheet name in cell A1 and in B1 enter:
=INDIRECT("'" & A1 & "'!A1" )

Related

Updating Excel VBA reference

I have 2 sheets in a workbook Sheet1 and Sheet2.
Sheet1 Cell A1 contains ='Sheet2'!B2
Sheet2 Cell B2 contains 01/10/2018 and is formatted for dates
Sheet2 Cell B3 contains 01/11/2018 and is formatted for dates
Using VBA, I want to read the contents of Sheet1 Cell A1 and then update its contents to read the next date in the list ie.to become ='Sheet2'!B3
The problem I am having is that when I try to access Sheet1 Cell A1 it returns the value of the date in Sheet2 B2 rather than the contents of A1.
Any help would be greatly appreciated - thank you.

Excel Workbook populate a date on sheet1 and return the hours of daylight in that day from the table in sheet2

Excel Workbook sheet1 calculates a date that populates cell J7 with the date as 15-AUG-2018
The same Workbook sheet2 contains a table of hours of the day for the entire year.
How can I return the value from the table on sheet2 for 15-AUG
to cell J8 on sheet1 when 15-AUG-2018 is populated?
But return the hours of the day value for any date that is populated in cell J7
So if 15-AUG-2018 populates cell J7 on sheet1 and sheet2 the table value of AUG-15 has 14:18 hours in the day so it would return 14:18 in cell J8 on sheet1
or if
10-APR-2018 populates cell J7 on sheet1 then sheet2 table value of APR-10 would return to cell J8 the hours for that day which is 13:24.
This is a LINK TO THE TABLE
Hours of Daylight Tables
You can use the index function to get the value from sheet2 to sheet1. Assuming that the data is in cells b2:m32 on sheet2, you can use the following formula is cell j8 of sheet1:
=IF(ISBLANK(INDEX(Sheet2!B2:M32,DAY(J7),MONTH(J7))),,INDEX(Sheet2!B2:M32,DAY(J7),MONTH(J7)))
This function checks if the corresponding cell is blank in sheet2 and if it is not, it returns the value from the row (which is the date extracted from the input date in j7 using day() function) and the column (which is the month extracted from the input date in j7 using the month() function)

How to get Column and row number of a calendar date

How to get Column and row number of a calendar date in excel?
Eg. Suppose my date is 26-May-17 so I should get rownumber=5 and column number=5
As I understand you are having dates from Jan1 in cell A1 till Jan 31 in cell A31 and similarly Feb1 in cell B1 till Feb 28 in cell b28, So this way you can use the below code.
Sub test()
MsgBox ActiveCell.Address(0, 0, xlR1C1)
End Sub

Excel: how to dinamically change sheet reference in formula

I have sheet A which is a big table with data referring to January and sheet B which extrapolate data from sheet A and in cell formulas there is the link to that sheet. Now I'd like to duplicate sheet A and sheet B naming them: A2 and B2 and formulas in B2 refer automatically to A2 data. is it possible or I have to change manually the reference to the new sheet?
thanks

Excel Datarange of 1 column across seperate sheets for column chart

So I have an excel with multiple tabs/sheets each representing a month, so i.e. August 2011, September 2011 etc.
On each sheet I have some data figures, and one important figure which is in Table column "D5" on every sheet.
What I am trying to do is create a new tab/sheet called summary, on and on this sheet have a column chart which represents this "D5" figure for each month.
How can I write the data range in excel for chart to get this figure on all sheets ?
You could do this in two steps:
In a new worksheet: a) in column A (say, starting with cell A1) list the names of the monthly worksheets (so, with August 2011 in cell A1, September 2011 in cell A2, and so on), b) in the first row of column B (say, cell B1), enter the formula `=INDIRECT("'"&A1&"'!D5"), and, c) copy the formula from cell B1 down to the other rows in column B.
Create a chart based on columns A and B in the new worksheet.
Use 'named ranges' to name each cell in a simple format.
Name Cell D5 on each sheet:
'January 2011'!D5 = IMPORTANT_JAN_2011
'February 2011'!D5 = IMPORTANT_FEB_2011
etc.
Then on the summary enter the following as the formula in the range(s) you want the data, for example
=IMPORTANT_JAN_2011
=IMPORTANT_FEB_2011

Resources