Try this formula

=SUMPRODUCT(($A$2:$A$15=D2)/COUNTIF($B$2:$B$15,$B$2:$B$15&""))

Row\Col
A
B
C
D
E
2
Joanna ECO60610 Joanna
1
3
Joanna ECO60610 Ilona
3
4
Joanna ECO60610 Sylwia
1
5
Ilona ECO56003 Marta
1
6
Sylwia ECO59237
7
Sylwia ECO59237
8
Sylwia ECO59237
9
Sylwia ECO59237
10
Sylwia ECO59237
11
Sylwia ECO59237
12
Marta ECO59824
13
Marta ECO59824
14
Ilona ECO60593
15
Ilona ECO59298