Mailing date issue

Titionebe -  
 Titionebe -

Hello,

I have a problem with my dates and my mail merge.

I have a spreadsheet in Excel where I insert dates, which are not necessarily precisely known. So I format them as 01/01/2000 for the better-known ones, Jan-2000 when I only know the month, 2000 when I only know the year, or simply "unknown date" when I don't know it. And so, when I do my mail merge, the cells formatted as dates give me the version retained by Excel (as a number of days since I don't remember when), which annoys me.

To solve this problem, I found the solution to create a second column (which is the one I use for mail merge) in which I put a formula that converts my date into plain text, allowing me to do efficient mail merging.

However, another problem arises, one that puzzles me and that I would like to share with you. I have tested formulas every which way, turning them this way and that, but I can't get what I want: a formula that allows me to translate dates in "dd/mm/yyyy" format into text, but leaves the others as they are.

Here are the last two attempts and their issues:
=IF(ISTEXT(A1),A1,IF(A1>DATE(1950,1,1),TEXT(A1,"dd/mm/yyyy"),A1))   which has the problem that dates like "Jul-19" are converted to "01/07/2019" instead of staying as "Jul-19"
=IF(TEXT(A1,"dd/mm/yyyy")<>A1,TEXT(A1,"dd/mm/yyyy"),A1)   which has the problem that dates like "2020" are translated to "12/07/1905" instead of staying as "2020"

In case you're wondering, I'm using version 2412 of Excel.

Thank you in advance for any help you can provide.


3 réponses

Titionebe
 

Thank you for your help, but I eventually found another solution. I noticed that the dates converted into the number of days were consistently above 10,000 (so 5 digits), and since we are before the year 10,000, the number of digits in the year was less than 5... so I made this formula: =IF(ISTEXT(AB2);AB2;IF(LEN(AB2)>=5;TEXT(AB2,"dd/mm/yyyy");AB2))

It's a workaround, not very elegant, but it works

1
NonoM45 Posted messages 1009 Registration date   Status Membre Last intervention   5
 

Hello,

My God, don’t bother with all that, it’s a known issue!!!

Just add a formatting to your field

Replace the merge field {Date_de_naissance} with {Date_de_naissance \@ ''dd/MM/yyyy''}

https://answers.microsoft.com/fr-fr/msoffice/forum/all/probl%C3%A8me-de-format-de-date/99efc38b-4d23-4f40-954b-5d850e7fe571

See you+

0
Titionebe
 

Hello, thank you for your quick response!

But this is indeed the first solution I've seen while scouring the forums... and what it gives me is that the dates that are supposed to be expressed with just the year are translated into date dd/mm/yyyy, which I don't want...

My problem comes from the fact that I need to manage multiple formats at the same time. That's why I need a solution with several conditions.

0
Argitxu Posted messages 5292 Registration date   Status Contributeur Last intervention   4 842 > Titionebe
 

Hello

For a date in day/month/year format, as Nono45 indicated to you:

{ChampDate\@ "dd//MM/yyyy"} where dd = day, MM = month, and YYYY = the year

To get a date with just the year {ChampDate\@ "yyyy"}

Argitxu

0
NonoM45 Posted messages 1009 Registration date   Status Membre Last intervention   5 > Titionebe
 

Hi,

You can put an IF THEN condition in your merge field, it's up to you to find the right wording!

1
ccm81 Posted messages 11033 Status Membre 2 434
 

Hello

Maybe set the date cells to text format before any entry

Best regards

0
NonoM45 Posted messages 1009 Registration date   Status Membre Last intervention   5
 

Hello,

It seems to remind me that this solution doesn't work, Word converts text dates into real dates...

0