I've been trying to figure out the best way to get data based on a current date and typically use vlookup but it won't allow 12 conditional statements to look at each month. I want to populate based on the current date retrieving from tables from each month assuming the table was extended out all the way to December in the same format.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]May[/TD]
[TD]May[/TD]
[TD]May[/TD]
[TD]May[/TD]
[TD]Jun[/TD]
[TD]Jun[/TD]
[TD]Jun[/TD]
[TD]Jun[/TD]
[TD]Jul[/TD]
[TD]Jul[/TD]
[TD]....[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]Wk3[/TD]
[TD]Wk4[/TD]
[TD]Wk1[/TD]
[TD]Wk2[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]Dep 1[/TD]
[TD]55[/TD]
[TD]12[/TD]
[TD]46[/TD]
[TD]79[/TD]
[TD]89[/TD]
[TD]56[/TD]
[TD]23[/TD]
[TD]12[/TD]
[TD]02[/TD]
[TD]15[/TD]
[TD]48[/TD]
[TD]78[/TD]
[TD]45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[/TD]
[TD]98[/TD]
[TD]85[/TD]
[TD]25[/TD]
[TD]41[/TD]
[TD]36[/TD]
[TD]75[/TD]
[TD]53[/TD]
[TD]12[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]Dep 5[/TD]
[TD]66[/TD]
[TD]55[/TD]
[TD]88[/TD]
[TD]31[/TD]
[TD]64[/TD]
[TD]97[/TD]
[TD]56[/TD]
[TD]89[/TD]
[TD]23[/TD]
[TD]15[/TD]
[TD]59[/TD]
[TD]26[/TD]
[TD]48[/TD]
[TD]97[/TD]
[TD]64[/TD]
[TD]31[/TD]
[TD]13[/TD]
[TD]46[/TD]
[TD]79[/TD]
[TD]82[/TD]
[TD]46[/TD]
[TD]58[/TD]
[TD]57[/TD]
[TD]54[/TD]
[TD]51[/TD]
[TD]52[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
So if it was 1/18/19 I would want to select all values in each department for the month of Jan...or if it was 11/15/19 I would want to select all values in each department for November and fill the table below with that data:
January
Dep 1 55 12 46 79
Dep 2 12 56 89 32
Dep 3 13 46 79 98
Dep 4 25 58 36 69
Dep 5 66 55 88 31
Thanks for any help getting past the nested if limitations with this!
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[/TR]
</tbody>[/TABLE]
</body>
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]Apr[/TD]
[TD]May[/TD]
[TD]May[/T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TD]46[/TD]
[TD]58[/TD]
[TD]57[/TD]
[TD]54[/TD]
[TD]51[/TD]
[TD]52[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
So if it was 1/18/19 I would want to select all values in each department for the month of Jan...or if it was 11/15/19 I would want to select all values in each department for November and fill the table below with that data:
January
Dep 1 55 12 46 79
Dep 2 12 56 89 32
Dep 3 13 46 79 98
Dep 4 25 58 36 69
Dep 5 66 55 88 31
Thanks for any help getting past the nested if limitations with this!
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[TD]Jan[/TD]
[/TR]
</tbody>[/TABLE]
</body>