|First, a posting tip...|
Please click on the blue sentence at the end of this post and read the instructions on how to post data in this forum. Following those instructions when posting data will make it much easier for us to understand the layout of your spreadsheet.
As for your question, you should review the Excel Help file for the IF function. Your question appears to be a fairly straightforward use of a basic IF statement.
You should read the Help file so that you understand the following suggestion and can adapt it to other situations.
Try this in A5:
=IF(A1="SOLD", A2, 0)
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.