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 shows you how to quickly apply, modify, and remove Excel table styles while preserving all table functionalities. Want to make your Excel tables look exactly how you want? Read on! After creating an Excel table, the first step is usual

This tutorial shows you how to use Excel's Subtotal feature to efficiently summarize data within groups of cells. Learn how to sum, count, or average, display or hide details, copy only subtotals, and remove subtotals altogether. Large datasets can

This tutorial explains the Compound Annual Growth Rate (CAGR) and provides multiple ways to calculate it in Excel. CAGR measures the average annual growth of an investment over a specific period, offering a clearer picture than simple year-to-year g

The tutorial explains the specificities of the SUBTOTAL function in Excel and shows how to use Subtotal formulas to summarize data in visible cells. In the previous article, we discussed an automatic way to insert subtotals in Excel by us

This tutorial introduces the Excel IFS function, a streamlined alternative to nested IF statements. It simplifies creating formulas with multiple conditions and improves readability. Available in Excel 365, 2021, and 2019, IFS significantly reduces

Improve Excel efficiency: Make good use of named regions By default, Microsoft Excel cells are named after column-row coordinates, such as A1 or B2. However, you can assign more specific names to a cell or cell range, improving navigation, making formulas clearer, and ultimately saving time. Why always name regions in Excel? You may be familiar with bookmarks in Microsoft Word, which are invisible signposts for the specified locations in your document, and you can jump to where you want at any time. Microsoft Excel has a bit of a unimaginative alternative to this time-saving tool called "names" and is accessible via the name box in the upper left corner of the workbook. Related content #

This tutorial shows you how to create interactive Excel checklists, to-do lists, reports, and charts using checkboxes. Checkboxes, also known as tick boxes or selection boxes, are small squares you click to select or deselect options. Adding them to

This tutorial unveils the power of Excel's Advanced Filter, guiding you through its use in retrieving records based on complex criteria. Unlike the standard AutoFilter, which handles simpler filtering tasks, the Advanced Filter offers precise contro


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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment