This is not a duplicate of previous, similar questions I've read on StackExchange, since none of those questions, nor the answers, go into the difficulty theory, as espoused on the Bitcoin Wiki.

Basically, I'm trying to calculate the number of attempts a miner needs to find a hash less than the target difficulty, through using some of the technical docs' on the Bitcoin Wiki. Hence, my answer is based on examples on that Wiki, but some of the explanations there are somewhat ambiguous. For example, I'm uncertain if the writer means difficulty1Target (they use difficulty_1_target), or difficulty 1. Therefore, I would be grateful if someone much more knowledgeable than I could run through my reasoning and also check my answer at the end.

The difficulty is calculated thus:

difficulty = difficulty1Target / currentTarget

Where target is a 256-bit (32-byte) number and difficulty1Target
represents a hash where the leading 32 bits are zero and the rest are
one. That is known as pool difficulty or pdiff. Floating point
targets with limited precision allow clients to approximate
difficulty. Such approximations are known as bdiff.

Each block stores a packed representation of the hexadecimal target.
Supposing a target of 0x1b0404cb, the hexadecimal target is:

The following formula shifts the target difficulty so that it is
offset against the difficulty1Target:

0xffff * 2^208

And to offset for difficulty D, we have:

(0xffff * 2^208)/D

Since a calculated hash to test against the target will be a random
number between 0 and 2**256-1 (SHA-256 is a 256-bit value), for any
given difficulty D, the algorithm for estimating the average number of
calculations needed before finding a solution, is as follows:

That question, nor the answers, go into the theory regarding difficulty targets, so this is not a duplicate. Having said that, I like, very much, one of the answers that use the published hash rate. Nice!
– glowkeeperOct 4 '18 at 13:13