begin your if statement with...

if(and(a1="",b1)="",......and then end the formula with...,"")