Average only if certain status

Hi, I am trying to create a formula that takes the average of a column called 'days in work', i only want to take the average if a different column 'status' has the status of the row shown as 'in progress'. I tried to do 

IF ( status column = "days in work, average (...)) 

but it did not work. I need help figuring out the correct nesting sequence. Thanks 

smartsheet question.PNG

Comments