Yes, but afdelingen would mean 'departments' rather than 'the department'. But it is still fun to see familiar words in another language!
it was a great surprise to learn how the letters AF- becomes the sound "OU" (as in "hOUse") so I was compelled to check it out in several translators, and voilà c'est vrai !! Does anyone know other astounding related words with "af" , please? tak!!
"Afdeling" is a department, "lejlighed" is a flat/apartment, so no, they aren't interchangeable, but I can see where the confusion is coming from