Calculate Median Age - Considering Distinct Count of Variable in another Variable

At this point you should make a reprex.
use dput() on A and share that here, formatted as code by writing triple backticks into the post

```
my text formatted as code 
```