Mann-Whitney U:Use of statistical functions in macro

I have two arrays A() and B() with experimental data and want to write a macro performing a Mann Whitney U test.

function MWU(A(10), B(20))
MWU = … 'rem returns the p-value indicting if both distribution are different.
end function

Has anybody code for this?

I don’t like this kind of statistics, and the posted question also didn’t convince me of a possible claim people applying statsitical test actually know what they do.
I did neither regard the “non-parametric” nor the “p-value” thing.
That “the distributions are different”, I would assume anyway.
To program a function returning the U-value and the z-value (where applicable following the linked advice) was rather simple.

Errors should be expected nonetheless - as well in my code or formulas, as in guides concerning statistical tests.
If somebody wants to actually apply the code included with the attachment, thorough considerations and checks are indispensable.
You may study the attached example. mann_whitney_U_test.ods

Yes, I agree in disliking this kind of stats. But that is the kind journaal reviewers expect. Anyway I realized that I am not allowed to use MWU because many datapoint come from the same person. So I wonder is there a similar function for Wilcoxon.

I never used the “MW” U-test, and also not the W-test, but the wikipedia and the “digital paper” from UZH I used to learn about the U-test also give the needed information about the W-test amd other means already suggested for similar purposes.
Simply take the function I provided as a frame and rework the content as needed. The responsibility is yours anyway.