Gå til hovedindhold

Hvordan konverteres dato til nummerstreng eller tekstformat i Excel?

I denne vejledning introducerer jeg flere metoder til løsning af forskellige sager om konvertering af dato til nummer eller tekstformat i Excel.
doc dato til nummertekst 1


1. Konverter dato til tekst

Dette afsnit indeholder metoderne til konvertering af dato til tekst i Excel.

For at konvertere dato til tekst skal du bare bruge en formel.

Formel: = TEKST (dato, ”dato_format”)

Reference: dato: cellen med den dato, du vil konvertere til tekst
datoformat: det format, du vil vise efter konvertering af dato til tekst

I nedenstående tilfælde vil jeg fortælle dig, hvordan du bruger denne formel.

1.1 Konverter dato til tekst i mm / dd / åååå-format

Konverter f.eks. Dato i celle A3 til mm / dd / åååå, brug formlen
= TEKST (A3, "mm / dd / åååå")
trykke Indtast nøgle
doc dato til nummertekst 2

Hvis du vil konvertere dato i celle A8 til dd / mm / åååå, skal du bruge denne formel
= TEKST (A8, "dd / mm / åååå")
trykke Indtast nøgle
doc dato til nummertekst 3

1.2 Konverter dato til tekst i mmddyyyy- eller ddmmyyyy-format

Hvis du vil konvertere dato i celle A13 til tekst, men i mmddyyyy-format, skal du skrive denne formel
= TEKST (A13, "mmddyyyy")
trykke Indtast nøgle
doc dato til nummertekst 4

Hvis du vil konvertere dato i celle A18 til tekst i ddmmyyyy-format, skal du skrive denne formel
= TEKST (A18, "ddmmyyyy")
trykke Indtast nøgle
doc dato til nummertekst 5

1.3 Konverter dato til tekst i andre formater

Faktisk uanset hvilket tekstformat du vil konvertere dato til, skal du bare skrive det format, du ønsker mellem anførselstegn i formlen.

Dato (A3) 12/23/2019
Formula = TEKST (A3, "mm-dd-åååå") = TEKST (A3, "mm / dd") = TEKST (A3, "dd") = TEKST (A3, "d / m / y")
Resultat 23-12-2019 23/12 23 23/12/19

Ny!
dato værktøjer

16 nye datofunktioner og funktioner løser 90% opgaver om databehandling i Excel for dig.

◆ Tilføj eller træk år / måneder / dage / uger til dato, klik for detaljer.

◆ Tilføj eller træk sekunder / minutter / timer til dato, Klik for mere.

◆ Tæl weekender / hverdage mellem to datoer. Klik for mere.

◆ Fjern tid fra dato. klik for detaljer.

◆ Konverter tid til decimal sekunder / munites / timer. klik for detaljer.

◆ Konverter flere datoformater til amerikansk standarddatoformat. klik for detaljer.

30-dages gratis prøveperiode med fuld feactures, 30 dages refusion uden grund.


2. Konverter dato til nummer

I dette afsnit giver jeg metoder til konvertering af dato til nummer i 5-cifret format i mmddyyyy-format.

2.1 Konverter dato til nummer i 5-cifret format

Hvis du vil konvertere dato til nummer i 5-cifret format, skal du bare gøre som disse:

1. Højreklik på den celle, der indeholder den dato, du vil konvertere til nummer, og vælg i højreklikmenuen formater celler fælles.
doc dato til nummertekst 6

2. i formater celler dialog , under nummer fane , vælg Generelt fra ruden i Boligtype.
doc dato til nummertekst 7

3. klik OK. Datoen i den valgte celle er konverteret til talstreng i mmddyyyy-format.
doc dato til nummertekst 8

2.2 Konverter dato til nummer i mmddyyyy eller ddmmyyyy format

Hvis du vil konvertere dato til nummerstreng i mmddyyyy eller ddmmyyyy-format, kan du også anvende funktionen Formater celler.

1. Højreklik på den celle, der indeholder den dato, du vil konvertere til nummer, og vælg i højreklikmenuen formater celler fælles.

2. i formater celler dialog under nummer fanebladet, vælg Tilpasset fra Boligtype rude, gå derefter til højre sektion, indtast mmddyyyy ind i Type tekstboks.
doc dato til nummertekst 9

3. klik OK. Datoen i den valgte celle er konverteret til talstreng i mmddyyyy-format
doc dato til nummertekst 10

Hvis du vil konvertere dato til talstreng i andet format, kan du tage nedenstående liste som reference.

Dato 2/23/2019
Formater celle som brugerdefineret ddmmåååå ddmyy mmåååå ååååååå
Skærm 23022019 230219 022019 20190223

3. Konverter dato til måned / dag / år eller andre datoformater med klik

Hvis du hurtigt vil konvertere dato til måned, dag, år eller andre datoformater, Anvend datoformatering nytte af Kutools til Excel vil være et godt valg at bruge.

Sig farvel til musens hånd og cervikal spondylose nu

300 avancerede værktøjer af Kutools til Excel løser 80 % Excel-opgaver på få sekunder, trækker dig ud af de tusindvis af museklik.

Håndter nemt 1500 arbejdsscenarier, ingen grund til at spilde tid på at søge løsninger, hav meget tid til at nyde dit liv.

Forbedre 80 % produktivitet for 110000+ yderst effektive mennesker hver dag, selvfølgelig inklusive dig.

For ikke at blive plaget af smertefulde formler og VBA, skal du give din hjerne et hvil og en glædelig arbejdsstemning.

30-dages gratis prøveperiode med alle funktioner, 30-dages pengene tilbage uden grund.

En bedre krop skaber et bedre liv.

Efter gratis installation af Kutools til Excelskal du gøre som nedenfor:

1. Vælg de celler, der indeholder de datoer, du vil konvertere til andre datoformater.

2. klik Kutools > dannet > Anvend datoformatering.
doc dato til nummertekst 11

3. i Anvend datoformatering vælg det datoformat, du vil bruge i Datoformatering i mellemtiden vil det konverterede resultat blive vist i højre side Eksempel rude.
doc dato til nummertekst 12

4. klik Ok, så er de valgte datoer konverteret til det valgte datoformat.
doc dato til nummertekst 13

Konverter dato til flere individualitetsdatoformatering med klik

anvende datoformatering

Flere tip til datokonvertering


Download prøvefil

prøve


Anbefalede produktivitetsværktøjer

Fanen Office - Gennemse faner, redigering, styring af dokumenter i Microsoft Office 2019-2003 og Office 365


fanen kontor

Kutools til Excel - Kombinerer mere end 300 avancerede funktioner og værktøjer til Microsoft Excel


fanen kutools
fanen kutoolsp
Comments (40)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I would very much appreciate your help with this formula.How can I switch month, date ,year “030624”in to a number 306042 and put the number in sequential order after the number 306042 like: 3060421
This comment was minimized by the moderator on the site
Hi, I would very much appreciate your help with this formula.How can I switch month, date ,year “030624”in to a number 306042 and put the number in sequential order after the number 306042 like: 3060421
This comment was minimized by the moderator on the site
Hello, how i convert 13.09.2023 to 13.9 my numbers change into dates
This comment was minimized by the moderator on the site
I want to know how many times I went to check the inspection. which I recorded by days.
This comment was minimized by the moderator on the site
Hello. I would very much appreciate your help with this formula. I am wishing to enter the customer's date of birth in cell I3 (custom formatting mm/dd/yy) and would like that date of birth to automatically populate in A3 cell as mmddyy along with adding the First letter from First name cell F3 and First letter from Last name cell G3 in order to have it auto-populate an ID# for our customers in our database.

A3 F3 G3 I3
ID# First Name Last Name Date of Birth
030199AS Adam Smith 03/01/1999

Thank you so much for any help. You have no idea how much I appreciate it. I have been wracking my brain all night to no avail. :(
Shena Bruno
This comment was minimized by the moderator on the site
Hi, Shena, Bruno, in A3, please use the formula =TEXT(I3, mmddyyyy")&LEFT(F3,1)&LEFT(G3,1).
In the formula, it can be explained as two parts:
TEXT(I3, mmddyyyy") will change the value in I3 to this format mmddyyyy
LEFT(F3,1)&LEFT(G3,1) will extract the first character from left side of the strings in cell F3 and G3.
Hope it is helpful.
This comment was minimized by the moderator on the site
I want to convert the day (Tuesday) which is showing up as 1/3/1900 when you click on it because I added a formula on the original data to provide me with Day values. Now I want to use a pivot table to show me the actual days. How do I convert the 1/3/1900 which shows up at Tuesday to just Tuesday? 
This comment was minimized by the moderator on the site
Hi, Cathey, do you want to convert the formula to an actual value? If so, you can use the Paste as Value Only feature in Excel to copy and paste the formulas as values only, or you can use Kutools for Excel's To Actual feature to convert formulas to values.
This comment was minimized by the moderator on the site
Hi, I was trying to copy and past the value but its still showing the date as opposed to the day. 
This comment was minimized by the moderator on the site
Hi, Cathey, do you choose the Paste as Value option in right-click context menu? If you have choosed, try to press Ctrl +1 keys to enable format cells feature and change the cell format to mm/dd/yyyy in Date section.
This comment was minimized by the moderator on the site
Hello. I have the date 26.01.2021 in the cell A1 and in another cell I have the formula: =RIGHT(A1,4) to take the year from that date, and it returns “4526” instead of “2021”. Do you know how to solve it? Thank you very much!
This comment was minimized by the moderator on the site
try to change the format on cell A1 to general or number and then enter the values that you want again to see if it helps. I think your problem is the format issue.
This comment was minimized by the moderator on the site
Hi, I want to convert month to number. For exp: 8 months (date format) ---> "8" as a number or value. I've change its format but I can't count it.Because I want to put it to math format, for exp: 8-2 = 6 (8 from the months). But the 8 doesn't work.Hope you get it. Thank you for helping!
This comment was minimized by the moderator on the site
Hi i have a date in "13/02/2020 11:42:09" format and i want in MM/DD/YYYY format
This comment was minimized by the moderator on the site
Hi, just select the cell then apply the Text to Columns, in the Text to Columns, choose Delimiter > Space > Date(in the Date format, choose DMY) > Finish.
This comment was minimized by the moderator on the site
There is another way, it returns exactly the numeric format that represents the date abbreviated by (/), it would be: '=Substitute(A1;"/";"")
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations