I had two objects quote1__c and quote_line_item__c with lookup relationship.
I am writing this validation rule at quote line item level
Quote_owner__c is formula field which get the quote1__r.Lastname from quote
if((Quote1__r.CreatedBy.LastName='Chirina'|| Quote1__r.CreatedBy.LastName='MILLIEZ'), (AND(ISNEW(), (Quote_owner__c=='Chirina'|| Quote_owner__c=='MILLIEZ'))), false)
when a new quote_line_item record is created it has to check the Quote_owner__c name - if it is "chirana" or "millez" it has to save the record, otherwise it has to throw error.