Step 1: Use the given functional relation.
We are given
\[
f(xy)=\frac{f(x)}{y}
\]
This relation is true for all positive real numbers \(x\) and \(y\).
We know
\[
f(30)=20
\]
We need to find
\[
f(40)
\]
Step 2: Express \(40\) in terms of \(30\).
Write
\[
40=30\times \frac{4}{3}
\]
Now compare with
\[
f(xy)=\frac{f(x)}{y}
\]
Take
\[
x=30
\]
and
\[
y=\frac{4}{3}
\]
Then,
\[
f(40)=f\left(30\times \frac{4}{3}\right)
\]
Using the functional equation,
\[
f(40)=\frac{f(30)}{\frac{4}{3}}
\]
Step 3: Substitute the given value.
Since
\[
f(30)=20,
\]
we get
\[
f(40)=20\times \frac{3}{4}
\]
\[
f(40)=15
\]
Step 4: Final conclusion.
Therefore,
\[
\boxed{15}
\]