I ask for your help to solve the following matter.
In a Google spreadsheet I have a sheet called "Database" that has the following data:
Item Department Budget Prev.Year Forecast
A3929232 Germany 1000 5.504 5050
B3232323 Germany 2000 4.500 5050
C6506506 Spain 3000 6.080 5080
D5046506 Spain 4000 9.090 7700
E5650600 Spain 5000 6.050 9900
I have another sheet called "Plan" that has the following:
Item Department New Amount
B3232323 Germany 5000
D5046506 Spain 2000
In the sheet "Plan" I would enter an amount in C2 (New Amount) for example 5000 and I would like a script that searches on the same row (A2) for Item B3232323 in the sheet "Database" and replace in "Database" column C with the new amount (replace old 2000 with new 5000).
I'd like that script to work on all rows of the sheet "Plan" that have values and if the script can't find in "Database" the Item and value should always be entered in the last row at the end of "Database".
The link of the file is the following: https://docs.google.com/spreadsheets/d/1ZPfB1DJD2LJIuSngU4NscziXJ3TCgTDtH-TS2_r7uBU/edit?usp=sharing
Thank you very much for your advice