• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

Excel: format (now(),"yyyymmdd") not working

i have an excel file and i am trying to populate a field with the following formula:

="batchid=" & Format(Now(),"yyyymmdd")

with no luck and receive the error #NAME#

can someone provide the formula that will work, please?

thank you..
0
intsup
Asked:
intsup
  • 4
  • 2
1 Solution
 
Martin LissRetired ProgrammerCommented:
Try

="batchid" & Format(Now(),"yyyymmdd")
0
 
intsupAuthor Commented:
still getting the #NAME? error
0
 
Martin LissRetired ProgrammerCommented:
What is batchid and if it's a VBA variable, where is it defined?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Martin LissRetired ProgrammerCommented:
Put this function in a module

Function BatchIDDate()
BatchIDDate = batchid & Format(Now(), "yyyymmdd")
End Function

Open in new window


and then do

=BatchIDDate()
0
 
intsupAuthor Commented:
batchid is simply a text field i need to put in front of the formatted date.  to simplify, change "batchid" to "todaysdate"

so that the excel cell will read
todaysdate=20120913

as for modules, remember, i'm in excel not access.  my format now function works in access but i need it to work in Excel, as well..
0
 
Robert SchuttSoftware EngineerCommented:
you can use TEXT() instead of Format() in a formula.
0
 
Martin LissRetired ProgrammerCommented:
Here you go

="todaysdate"&TEXT(NOW(),"yyyymmdd")
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now