Create Invoice Numbers with Month and Company Number in Excel
Question details
Create an invoice ID by combining a text prefix, month, and company number when a condition is met.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet needs invoice IDs such as VR-JULY-200 based on a condition in the same row.
- Observed behavior
- The desired formula displays the combined ID when the condition is met and leaves the result blank otherwise.
Identify the cell containing the company number and the numeric cell that controls whether an ID appears. The examples use A5 for the company number and I5 for the condition.
Build an invoice ID using the current month
Use this formula when the ID should appear only if I5 contains a number greater than zero.
Enter the company number, such as 200, in A5 and a positive number in I5.
Select the cell for the invoice ID and enter =IF(I5>0,"VR-"&UPPER(TEXT(TODAY(),"MMMM"))&"-"&A5,"").
Press Enter, then drag the formula cell's fill handle down to generate IDs for other rows.
Once an invoice ID is issued, copy its formula cell and use Home > Paste > Paste Values to prevent the month from changing later.

Build an invoice ID from a month stored in a cell
Use a month from the worksheet when the invoice month should not depend on today's date.
Create conditional invoice IDs in WPS Spreadsheets
Use IF, TEXT, and TODAY in WPS Spreadsheets to combine a prefix, the current month, and a company number into an invoice ID.
- 1. Open your worksheet: Open WPS Spreadsheets and choose File > Open to select your invoice workbook.
- 2. Enter the source values: Enter a company number in A5 and a positive number in I5, or adjust the formula references to match your worksheet.
- 3. Enter the formula: Select the invoice ID cell and enter =IF(I5>0,"VR-"&UPPER(TEXT(TODAY(),"MMMM"))&"-"&A5,""). Press Enter.
- 4. Apply and preserve the IDs: Drag the fill handle down for other rows. For issued invoices, copy the results and use Paste Special > Values so the month does not update later.

Frequently Asked Questions
Why is the invoice ID cell blank?
The example formula returns a blank when I5 is not greater than zero. Check the value in I5 and confirm that the formula references the intended row.
How do I use a different invoice prefix?
Edit the formula in the invoice ID cell and replace "VR-" with your preferred prefix, such as "INV-".
How can I stop the month from changing?
Copy the issued invoice ID and use Home > Paste > Paste Values. Alternatively, reference a fixed invoice date cell with TEXT(date_cell,"MMMM").
Will this formula create a unique number for every invoice?
No. Invoices with the same company number and month will have the same ID. Add a separate unique invoice sequence to the formula if each invoice needs a distinct ID.




