How to automatically generate document number in excel
The form that only adds data is the most basic form. Some document forms with fixed content will be more complicated. In the documents produced by Excel, some contents need to automatically generate some data for the sake of continuity and authenticity to facilitate recording. We For frequently seen invoices, the machine-printed invoice numbers are automatically consecutive to prevent tax evasion. How are these document numbers automatically generated? Let’s listen to the explanation below.
For example, when generating the number of the outbound order, a combination of English letters and numbers is usually used. The English letter part of the number may use the capital form of the first letter of the document type. For example, the outbound document can be prefixed with CK.
Method 1: Use the simplest rand function, which can generate a random number between 0-1. Then our encoding can be completed as follows:
1. Multiply the rand function by 1000 in order to change the integer part into 3 digits.
2, and then obtain it through the round function. The integer part with 0 decimal places
3. The overall formula of connecting "CK" English letters through the connector & is: "NO.CK-"&ROUND(RAND()*1000,0).
Method 2: Use the today function of the date function to obtain the year, month and day of the current day as the code.
Then our coding can be completed as follows:
1. Use today to get the current date
2. Then use the text function to get today’s date. The year, month and day are displayed
3, and the English letters "CK" are connected through the connector &. The overall formula is: =="NO.CK-"&TEXT(TODAY(),"yymmdd") .
Method 3: Use the now function of the date function to obtain the real-time time of the day as the encoding.
Then our coding can be completed as follows:
1. Use now to get the current time. This function contains the year, month, day, hour, minute, second, etc.
2. Then use the text function to display the specific numbers of year, month, day, hour, minute and second, without displaying symbols such as "-" and ":"
3. Connect the English letters "CK" through the connector &
The overall formula is: ="NO.CK-"&TEXT(NOW(),"yymmddhhmmss").
Method 4: Use the now function of the date function combined with the today function to obtain the decimal part of the time number.
Then our coding can be completed as follows:
1. Use now to get the current time. This function contains the year, month, day, hour, minute, second, etc.
2. Use today to get the current date
3. Subtract the two to get the decimal part (specifically hours, minutes and seconds)
4. Then use the round function to obtain 3 decimal places and then multiply with 1000
5. Connect the "CK" English letters
through the connector &. The overall formula is: =="NO.CK-"&ROUND((NOW()-TODAY()), 3)*1000.
The above describes several methods of automatically generating numbers. Depending on the settings, the content of the generated numbers is also different. The format content can be selected according to the requirements of actual work. After learning this method, we can also set numbers in our own journals for statistics in the future, and office software will also be used in daily life.
The above is the detailed content of How to automatically generate document number in excel. For more information, please follow other related articles on the PHP Chinese website!

This tutorial explains the Excel SUMIF function in plain English. The main focus is on real-life formula examples with all kinds of criteria including text, numbers, dates, wildcards, blanks and non-blanks. Microsoft Excel has a handful o

In this article, you will learn how to build an Excel IF statement for different types of values as well as how to create multiple IF statements. IF is one of the most popular and useful functions in Excel. Generally, you use an IF statem

This tutorial shows how to sum a column in Excel 2010 - 2016. Try out 5 different ways to total columns: find the sum of the selected cells on the Status bar, use AutoSum in Excel to sum all or only filtered cells, employ the SUM function

In this tutorial you will learn what a PivotTable is, find a number of examples showing how to create and use Pivot Tables in all version of Excel 365 through Excel 2007. If you are working with large data sets in Excel, Pivot Table comes

This tutorial explains the difference between the SUMIF and SUMIFS functions in terms of their syntax and usage, and provides a number of formula examples to sum values with multiple AND / OR criteria in Excel 365, 2021, 2019, 2016, 2013,

Excel wildcards: a powerful tool for efficient search and filtering This article will dive into the power of wildcards in Microsoft Excel, including their application in search, formulas, and filters, and some details to note. Wildcards allow you to perform fuzzy matching, making it more flexible to find and process data. *Wildcards: asterisks () and question marks (?)** Excel mainly uses two wildcards: asterisk (*) and question mark (?). *Asterisk (): Any number of characters** The asterisk represents any number of characters, including zero characters. For example: *OK* Match the cell containing "OK", "OK&q

The tutorial shows how to create multiple IF statements in Excel with AND as well as OR logic. Also, you will learn how to use IF together with other Excel functions. In the first part of our Excel IF tutorial, we looked at how to constru

In this tutorial, you will lean a quick way to calculate percentages in Excel, find the basic percentage formula and a few more formulas for calculating percentage increase, percent of total and more. Calculating percentage is useful in m


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
