Formla: change sheets not cells

ThinkTankTop

New Member
Joined
Aug 30, 2019
Messages
4
I have a workbook that has many sheets labeled by the date at such "7-1-19".

Each day has a set of cells J3, K3, L3 with values that I need to graph per day. I'd like place them in columns with the date.
For example
7-1-19 J3 K3 L3
7-2-19 J3 K3 L3
7-3-19 J3 K3 L3 ...and so on.

I'd like to have them all in one sheet so I can graph the data and easily reference the table.

I found this post, but I could not get the formula to work for me:
https://www.mrexcel.com/forum/excel...l-reference-when-dragging-down-formula-2.html

Thanks in advance. I appreciate your help.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi ThinkTankTop,

I'd just go INDIRECTly to the cells based on a list of dates.

My test data just has 3 tabs for 1st, 2nd and 3rd July 2019

BCDE
1SheetsJKL
27-1-19606672
37-2-199099108
47-3-19120132144
57-4-19
67-5-19

<tbody>
</tbody>
Summary

Worksheet Formulas
CellFormula
C2=IFERROR(INDIRECT("'"&TEXT($B2,"m-d-yy")&"'!"&C$1&"3"),"")
D2=IFERROR(INDIRECT("'"&TEXT($B2,"m-d-yy")&"'!"&D$1&"3"),"")
E2=IFERROR(INDIRECT("'"&TEXT($B2,"m-d-yy")&"'!"&E$1&"3"),"")
B3
=B2+1

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Sorry for the late reply. I appreciate you taking the time to assist. I'm not quite understanding how the "indirect" formula works, so there is some definite user error here. I've tried it, but I can't get the correct cells to reference.

I managed to come up with the following so far: ='7-1-19!J3

I repeated that formula for the next two columns referencing K3 and L3 which returns the correct values from those sheets. However, I cannot just drag this formula down rows. the next sheets are "7-2-19", "7-3-19", etc.

Is there a way to have excel change the sheet reference down rows quickly? Alternatively, I could just be having trouble with your formula.

Thanks again!
 
Upvote 0
The TEXT statement
Code:
="'"&TEXT($B2,"m-d-yy")&"'!"&F$1&"3"

is putting a single quote followed by the column B date, then an exclamation mark and a closing single quote, then the contents of F1 (the letter J), then the text "3". That gives us the cell reference for sheet 7-1-19 and cell J3.

I can copy across because F is relative but 1 is absolute for the F$1 so it works for G1 and H1.
I can copy that row 2 set of formulae down because $B is absolute but the 2 in $B2 is relative so it will pick up the next date in B3.

If I take away the IFERROR (there in case there's no sheet named that date) and the INDIRECT I end up with just that TEXT statement which gives me:

JKL
'7-1-19'!J3'7-1-19'!K3'7-1-19'!L3
'7-2-19'!J3'7-2-19'!K3'7-2-19'!L3
'7-3-19'!J3'7-3-19'!K3'7-3-19'!L3
'7-4-19'!J3'7-4-19'!K3'7-4-19'!L3

<tbody>
</tbody>

If your dates are sequential for the sheet names then Excel holds date as number of days since 1st January 1900 (or 1904 for Apple) so I can type my first date in B2 then in B3 put =B2+1 to get the next day. Copy that down as far as needed. The IFERROR will gives null results if no such sheet is found.

The INDIRECT is taking the result we get from the TEXT, such as '7-1-19'!J3 and saying this is a reference to the cell we want so go to sheet '7-1-19'! and retrieve the contents of J3 to pull the contents back into the cell with the INDIRECT statement.

Clearer or muddier?
 
Upvote 0

Forum statistics

Threads
1,214,399
Messages
6,119,279
Members
448,884
Latest member
chuffman431a

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top