[Solved] Current date in validity dropdown list

Discuss the spreadsheet application
Locked
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

[Solved] Current date in validity dropdown list

Post by donnje »

Hello,
I have a column with a drop-down menu connected to another column with all the calendar dates, is there a way to open the drop-down menu and have the current date without having to scroll and search for it?
thanks

 Edit: Changed subject, was Automatic date 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Attachments
date.ods
(12.7 KiB) Downloaded 12 times
Last edited by MrProgrammer on Thu Jun 19, 2025 6:52 pm, edited 3 times in total.
Reason: Tagged ✓ [Solved] Use =TODAY()+ROW()-cell; No response from donnje
LibreOffice 24.8.6.2
FJCC
Moderator
Posts: 9543
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Automatic date

Post by FJCC »

I put the formula

Code: Select all

=TODAY()

in the cells E4 and E191 on the sheet Foglio2. The list now has today's date as its first and last entry. Its important to set the formatting of those cells to match the date format you want displayed in the list. Otherwise, the drop down list will display the numeric value of the date.
If you want only today's date to be available, change the range of the Validity list to one cell containing the formula =TODAY().
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Alex1
Volunteer
Posts: 828
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Find current date in validity dropdown list

Post by Alex1 »

Ctrl+; puts the current date in a cell in LibreOffice. This doesn't work in OpenOffice.
AOO 4.1.15 & LO 24.8.4 on Windows 10
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Find current date in validity dropdown list

Post by donnje »

maybe I explained myself badly, at the moment I already have the drop-down menu with the dates but I would like it to automatically give me the current date, while also leaving the possibility of inserting other dates
LibreOffice 24.8.6.2
User avatar
karolus
Volunteer
Posts: 1226
Joined: Sat Jul 02, 2011 9:47 am

Re: Find current date in validity dropdown list

Post by karolus »

donnje wrote: Wed May 21, 2025 7:43 am maybe I explained myself badly, at the moment I already have the drop-down menu with the dates but I would like it to automatically give me the current date, while also leaving the possibility of inserting other dates
Extend the source-range of the other dates with one cell wich holds the Formula:

Code: Select all

=TEXT(TODAY();"yyyy-mm-dd")
you may able to change the format-string to your needs??
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 24.8… flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Find current date in validity dropdown list

Post by donnje »

karolus wrote: Wed May 21, 2025 12:13 pm
donnje wrote: Wed May 21, 2025 7:43 am maybe I explained myself badly, at the moment I already have the drop-down menu with the dates but I would like it to automatically give me the current date, while also leaving the possibility of inserting other dates
Extend the source-range of the other dates with one cell wich holds the Formula:

Code: Select all

=TEXT(TODAY();"yyyy-mm-dd")
you may able to change the format-string to your needs??
I read =TEXT(TODAY();"2025-05-21") butI have a error
LibreOffice 24.8.6.2
Alex1
Volunteer
Posts: 828
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Current date in validity dropdown list

Post by Alex1 »

"yyyy-mm-dd" must be used literally, not substituted. It's a format specification.
AOO 4.1.15 & LO 24.8.4 on Windows 10
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

Alex1 wrote: Wed May 21, 2025 5:10 pm "yyyy-mm-dd" must be used literally, not substituted. It's a format specification.
idem error :(
LibreOffice 24.8.6.2
Alex1
Volunteer
Posts: 828
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Current date in validity dropdown list

Post by Alex1 »

It may depend on your local settings whether yyyy-mm-dd is understood or not.
What does the Format code field show when you press Ctrl+1 and select Date in the Category list?
AOO 4.1.15 & LO 24.8.4 on Windows 10
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

the format is DD/MM/YYYY
but even if I replace in

=TEXT(TODAY();"dd-mm-yyyy")

it always gives me an error, maybe I'm doing something else wrong
LibreOffice 24.8.6.2
User avatar
RoryOF
Moderator
Posts: 35062
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Current date in validity dropdown list

Post by RoryOF »

Are you by any chance editing your code in Writer, which is set to change quotes into curly quotes?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

RoryOF wrote: Wed May 21, 2025 6:21 pm Are you by any chance editing your code in Writer, which is set to change quotes into curly quotes?
no I dont
can someone try the formula and upload the file please?
LibreOffice 24.8.6.2
User avatar
Zizi64
Volunteer
Posts: 11477
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Current date in validity dropdown list

Post by Zizi64 »

can someone try the formula and upload the file please?
Here is:
Date_DataValidity.ods
(13.03 KiB) Downloaded 4 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

Zizi64 wrote: Wed May 21, 2025 6:44 pm
can someone try the formula and upload the file please?
Here is:

Date_DataValidity.ods
thanks I understand
but I would like that by opening the drop-down menu today's date automatically appears 21, tomorrow the 22nd and so on
LibreOffice 24.8.6.2
User avatar
Zizi64
Volunteer
Posts: 11477
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Current date in validity dropdown list

Post by Zizi64 »

but I would like that by opening the drop-down menu today's date automatically appears 21, tomorrow the 22nd and so on
Just use the function
=TODAY()
=TODAY()+1
=TODAY()+2
...
in the source cell range of the DataValidity cell.



...Or do you want to use the text
"Yesterday"
"Today"
"Tomorrow"
instead of the date values?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

Zizi64 wrote: Wed May 21, 2025 7:15 pm
but I would like that by opening the drop-down menu today's date automatically appears 21, tomorrow the 22nd and so on
Just use the function
=TODAY()
=TODAY()+1
=TODAY()+2
...
in the source cell range of the DataValidity cell.



...Or do you want to use the text
"Yesterday"
"Today"
"Tomorrow"
instead of the date values?
great it is works
is there a way for to have a calendar dates faster so you don't have to copy +1 +2 etc every time
LibreOffice 24.8.6.2
User avatar
Zizi64
Volunteer
Posts: 11477
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Current date in validity dropdown list

Post by Zizi64 »

is there a way for to have a calendar dates faster so you don't have to copy +1 +2 etc every time
Please upload YOUR sample file here to see the desired structure of the data.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
donnje
Posts: 30
Joined: Sun Apr 20, 2025 4:06 pm

Re: Current date in validity dropdown list

Post by donnje »

Zizi64 wrote: Wed May 21, 2025 7:46 pm
is there a way for to have a calendar dates faster so you don't have to copy +1 +2 etc every time
Please upload YOUR sample file here to see the desired structure of the data.
thanks
Attachments
Test.ods
(25.33 KiB) Downloaded 6 times
LibreOffice 24.8.6.2
Alex1
Volunteer
Posts: 828
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Current date in validity dropdown list

Post by Alex1 »

Fill the validity table with =TODAY()+ROW()-some cell containing a constant.
AOO 4.1.15 & LO 24.8.4 on Windows 10
Locked