View Single Post
 
Old 05-25-2017, 11:02 AM
robot robot is offline Windows 7 64bit Office 2007
Novice
 
Join Date: May 2017
Posts: 1
robot is on a distinguished road
Default Using VLOOKUP to autopopulate Unit Cost without changing old entries

Hi,
New member to this awesome forum.

I have a spreadsheet that tracks what supplies (Item) are delivered to different buildings on specific dates.

Sheet1 = VistaBuilding
Column A = Date
Column B = Address
Column C = City
Column D = Item
Column E = Quantity
Column F = Unit Price
Column G = Price Total

Sheet2 = CostLookUpTable
Column A = Item
Column B = UnitCost

In Column F:
=IF(D2="","",VLOOKUP(D2,CostLookupTable!$A$2:$B$51 ,2,FALSE))

I want to enter the Item name in column D and use VLOOKUP in Column F to auto-populate the Unit Price. However, the Unit Price can change periodically.

My question is, how can I have new entries grab the new Unit Price but prevent older entries from changing the Unit Price? Is this possible with a formula by looking at the entry date? Or would I need to use VBA? If VBA, can you give me an example?

I will have multiple tabs with different building names to enter the delivered supplies.

My VLOOKUP works to auto-populate, but the values change for previous entries.

Thanks to all in advance for the help!
Reply With Quote