web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formula for date as a ...
Power Apps
Answered

Formula for date as a decimal for Excel entry from a date chosen from a date picker

(0) ShareShare
ReportReport
Posted on by 291

Hi,

I am using the following formula to Patch the date to an Excel file (column name DecimalDay):

 

 

DecimalDay: DateDiff(
 DateTimeValue("1/1/1900")-2,
 Today(),
 Days
 ) + (DateDiff(
 Today(),
 Now(),
 Minutes
 ) / 1440),

 

I am doing this because of the countless problems I have had with PowerApp dates transferring to Excel. They seem to appear differently in the background Excel file depending on what the app is running on (PC, phone, tablet etc.). There are also issues with time zones meaning that the date as uploaded from PowerApps is  one day out.

 

However, what I now want to do is replace the Today() and Now() part of the formula above with the selected date from a date picker. This is so that people have the option of putting in data to the Excel file from a previous date that they choose.

 

How do I replace the Today() and Now() bit of the formula with the selected date? I have tried DatePicker.SelectedDate but that doesn't work.

 

Thanks,

Izzy.

Categories:
  • Verified answer
    IzzyWizz Profile Picture
    291 on at

    So, I thought I would try the DatePicker.SelectedDate once more, just to make sure and it worked. I can't see that I have done anything different to the first time but the red dot has gone and I have tested it.

     

    Just in case anyone is having the same issue, my formula from the Patch is:

     

     DecimalDay: DateDiff(
     DateTimeValue("1/1/1900")-2,
     DatePickerWorkshopMeters.SelectedDate,
     Days
     ) + (DateDiff(
     DatePickerWorkshopMeters.SelectedDate,
     DatePickerWorkshopMeters.SelectedDate,
     Minutes
     ) / 1440),

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard