I am having trouble putting my dates into a month (1/2/2019 ----->>> January). Then sorting the list by month order (Not in alphabetical order). I created a virtual column โMonthโ. I used this to switch the date format to a month:
SWITCH(
MONTH(TODAY()),
1, โJanuaryโ,
2, โFebruaryโ,
3, โMarchโ,
4, โAprilโ,
5, โMayโ,
6, โJuneโ,
7, โJulyโ,
8, โAugustโ,
9, โSeptemberโ,
10, โOctoberโ,
11, โNovemberโ,
12, โDecemberโ,
โโ
)
This did not allow me to sort in order per month.
I then tried this: (on my virtual column and the actual date column)
INDEX(
LIST(
โJanโ, โFebโ, โMarโ, โAprโ, โMayโ, โJunโ,
โJulโ, โAugโ, โSepโ, โOctโ, โNovโ, โDecโ
),
MONTH(TODAY())
)
Still will not sort in month order.
Any ideas?
Thanks in advance
Solved! Go to Solution.
For the virtual column, youโll need to prefix the month name with a number that will sort as desired:
CONCATENATE(
MONTH([invoice_date]),
"-",
SWITCH(
MONTH([invoice_date]),
1, โJanuaryโ,
2, โFebruaryโ,
3, โMarchโ,
4, โAprilโ,
5, โMayโ,
6, โJuneโ,
7, โJulyโ,
8, โAugustโ,
9, โSeptemberโ,
10, โOctoberโ,
11, โNovemberโ,
12, โDecemberโ,
โโ
)
)
or:
CONCATENATE(
MONTH([invoice_date]),
"-",
INDEX(
LIST(
โJanโ, โFebโ, โMarโ, โAprโ, โMayโ, โJunโ,
โJulโ, โAugโ, โSepโ, โOctโ, โNovโ, โDecโ
),
MONTH([invoice_date])
)
)
For the virtual column, youโll need to prefix the month name with a number that will sort as desired:
CONCATENATE(
MONTH([invoice_date]),
"-",
SWITCH(
MONTH([invoice_date]),
1, โJanuaryโ,
2, โFebruaryโ,
3, โMarchโ,
4, โAprilโ,
5, โMayโ,
6, โJuneโ,
7, โJulyโ,
8, โAugustโ,
9, โSeptemberโ,
10, โOctoberโ,
11, โNovemberโ,
12, โDecemberโ,
โโ
)
)
or:
CONCATENATE(
MONTH([invoice_date]),
"-",
INDEX(
LIST(
โJanโ, โFebโ, โMarโ, โAprโ, โMayโ, โJunโ,
โJulโ, โAugโ, โSepโ, โOctโ, โNovโ, โDecโ
),
MONTH([invoice_date])
)
)
Ok. And use the virtual column to do this?
Neither worked. All it does is put everything under - October?
Also, am i suppose to do something with the original column - โinvoice_dateโ to index the date format?
Ah, yes, thatโs important! Iโve updated the instructions above to use [invoice_date]
rather than TODAY()
. Try that.
You are the man! That worked. Thanks again. You have helped me out with so much.
User | Count |
---|---|
32 | |
31 | |
30 | |
19 | |
17 |