excel to python median if calculation?

Occasional Visitor
srnoskurpsplp
1watch34279932432524
2watch34279932423423
3watch34279934322343
4watch342799324323423
5-32433243234
6watch34279932443242
7watch25324332432343
8handbag253242324223423
9handbag2532422453243
10watch34279923553232
11-3243234532432
12watch342799233243
13watch34279945423434
14-3243354432343
15handbag253242454332434


={MEDIAN(IF($B$2:$B$16=B2,$D$2:$D$16))}
={MEDIAN(IF($B$2:$B$16=B3,$D$2:$D$16))}
={MEDIAN(IF($B$2:$B$16=B4,$D$2:$D$16))}
so on column of median
calculation of (median if) till now using above formula but it takes so much time on excel while doing on lots of data in row how can we convert this into python to make calculation faster

1 Reply
Hello @Dynamo14324
Just playing the Devil's advocate how do you know that Python will be any faster?
What I would suggest is to figure out what is going on to slow down this process and then figure out how to speed it up. I tried this on my development machine (3.07 gigahertz Intel Xeon X5675 (2 installed) and MS-Excel is using all 24 Hyper-threads) and it took a millisecond! No I did not measure the time, I just guesstimated. Tell us what version of MS-Excel are you using and stuff like that and lets see if we can help you speed this up.