Try:

=IF(D1=C1,A1&REPT(".",10)&B1,"")


replace the 10 in REPT(".",10) with number of dots (or other character) you want.