Any customers with #N/A are new customers and need to be added to the list of customers in column A. If you get a few #N/A values, sort by column F to bring the new customers together. Copy just the customer name and paste to the bottom of the list in column A. Enter $0 as the sales in column B for the new customers.

In the current example, only Ford is new, so you can copy Ford from D9 and paste to A26. Enter zero in B26.

You’ve now completed the first of three steps. The next step is to add the real VLOOKUP to the first list.

=VLOOKUP(A6,$E$6:$F$16,2,FALSE) would return a mix of revenue values and #N/A errors. When an existing customer had no revenue on June 18, the result of the VLOOKUP will be #N/A. You can use the new IFERROR function to replace those #N/A values with zeroes.

Insert two new columns before column D. Label these temporary columns Addl Rev and New Total.

The formula in the new C6 is =IFERROR(VLOOKUP(A6,$F$6:$G$16,2,FALSE),0). Copy that formula down to row 26.

Figure 448 Do a VLOOKUP to get sales from June 18 in the first list.

If you want to check your work, use AutoSum to add a total at the bottom of column C and the bottom of column G. Both totals should match.

That completes step two of three steps. The final step is to combine revenue from column B and column C.

In D6 enter a formula of =B6+C6. Copy this formula down.

Figure 449 Add the old and new revenue.

Copy D6:D26. Select B6 and Paste Values.

Gotcha: Don’t worry that column D is showing a higher value than it should. Column D is still adding the current day’s revenue to the new total in B. You will be deleting column D very soon. If you don’t want column D to ever show a wrong value, you could copy D and paste values on top of itself first.

Change the date in A3 to indicate that the report has data through 6/18.

Delete the temporary columns C through H.

It looks like the original data was sorted by descending revenue. Choose cell B6 and click the ZA button on the Data tab of the ribbon.

SHARE

Additional Info

Spread the Word Excel

MrExcel.com & related websites debuted on November 21, 1998.

ExcelArticles.com provides examples of Formulas, Functions and Visual Basic procedures for illustration only,
without warranty either expressed or implied, including but not limited to the implied warranties of
merchantability and/or fitness for a particular purpose. The Formulas, Functions and Visual Basic procedures
on this web site are provided "as is" and we do not guarantee that they can be used in all situations.
This site contains affiliate links. Any affiliate commissions that we earn when you click a link to Amazon
or other sites is reinvested in keeping MrExcel.com and ExcelArticles.com running. You can earn a commission for
sales leads that you send to us by joining our affiliate program. View my Privacy Policy.

Excel ® is a registered trademark of the Microsoft Corporation.
MrExcel ® is a registered trademark of Tickling Keys, Inc.