selecting multiple criteria returning headers

From the example spreadsheet attached, I have tried using index and match, if statements, but to no avail, or maybe im missing something, but what im hoping to create is from the attached I havent included drop down menus, but I wanted to return the heading "contract term 1 etc.... if specific criteria were met from the drop down menu's.

Hi, thanks for your reply, I'm trying to return the headers when the user selects a painter from a drop down box, but if the data is blank then it will return a blank result, e.g. user selects painter 2 this will return all the column headers for painter 2.

Many thanks for the reply, it works like a treat, you are awesome, however, if i wanted to return the data rather than the column header, but use the drop down box and the column headers as the lookups, would I just use a standard index and match function even if there are blanks using the spreadsheet you have attached?