Function Problems

Create Invoice Numbers with Month and Company Number in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 18, 2026 869 views

Question details

Create an invoice ID by combining a text prefix, month, and company number when a condition is met.

Create Invoice Numbers with Month and Company Number in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the source values

Enter the company number, such as 200, in A5 and a positive number in I5.

2
Add the formula

Select the cell for the invoice ID and enter =IF(I5>0,"VR-"&UPPER(TEXT(TODAY(),"MMMM"))&"-"&A5,"").

3
Apply it to other rows

Press Enter, then drag the formula cell's fill handle down to generate IDs for other rows.

4
Keep an issued ID fixed

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 using the current month
The current month changes: TODAY() updates with the current date, so formula results can change in a later month. The formula also does not guarantee unique IDs for multiple invoices from the same company in the same month.
WPS Spreadsheets

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. 1. Open your worksheet: Open WPS Spreadsheets and choose File > Open to select your invoice workbook.
  2. 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. 3. Enter the formula: Select the invoice ID cell and enter =IF(I5>0,"VR-"&UPPER(TEXT(TODAY(),"MMMM"))&"-"&A5,""). Press Enter.
  4. 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.
Generate invoice IDs only when a numeric condition is metOpen and save Microsoft Excel XLSX filesFill the formula down for multiple company recordsUse a familiar spreadsheet interface
microsoft office alternative - wps office

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.