General formula for all possible propositions in two variables? Given p and q, where p and q have either the value True or False, a function f returns either True or False. One example:
p     q     f
True  True  True
True  False True
False True  False
False False True

Here f could be ${\lnot p \land q}$. There are ${2^4}$ possible outcomes for two variables, meaning there are at least ${2^4}$ unique functions. Is there a general way to figure out all possible functions?
I can only think of listing all possibilities, and thinking of a function that matches that combination. But this way doesn't scale, if you start thinking about functions of $3,4,5,...$ variables. 
Edit:
For context this question comes from the book, The Haskell Road to Logic, Maths and Programming [link], page 60 of the pdf file, Exercise 2.21.
 A: Perhaps you're looking for something like this:
$$ f_A(p_0,\ldots p_{n-1}) =
\lfloor A/2^b \rfloor \bmod 2
\quad\text{where }
b = \sum_{i=0}^{n-1} 2^i p_i $$
where $A\in\{0,1,2,\ldots,2^{2^n}-1\}$ is an index of the function and truth values are represented by $0$ and $1$.
How this works is that $A$ is the final column of the truth table, interpreted as a binary number. The computation of $b$ gives which row of the truth table we're in, and $\lfloor A/2^b\rfloor \bmod 2$ then picks out that bit from $A$.
(In a curly-bracket programming language you would write (A>>b)&1).

In practice, doing this as arithmetic does not really scale to more than 6 variables. In order to represent arbitrary propositional functions, you would need a different way to represent a bit vector with more than $2^n$ bits. However, in many practical applications, the functions you actually want to represent are not completely random and can be more compactly represented in other ways -- look into binary decision diagrams, for example.
A: I am not sure what your question is ... but if you are looking for a way to match any given truth-function using some formula:
Here is a method that always works, for any function, using any number of variables. 
Let's take your truth-table: 
p     q     f
True  True  True
True  False True
False True  False
False False True

For every row where the function comes out True, generate a term that is the conjunction of literals corresponding to that row. That is, the function is True in the first row, and that's where both $p$ and $q$ are True, so the first row gives us term $p \land q$.  The second row gives you $p \land \neg q$, and the fourth corresponds to $\neg p \land \neg q$.
Then put all these terms into one big disjunction, so you get:
$(p \land q) \lor (p \land \neg q) \lor (\neg p \land \neg q)$
If you were to put this statement on a truth-table, you'll find that it captures exactly your function $f$.  I hope you see how you can use this method no matter how many $True$'s you have in the truth-table, and no matter how many variables are involved.
Oh: one special case: what if there are no True's in the function? Well, then the function is a contradiction, so you can just use something like $p \land \neg p$
Just to give an example for 3 variables:
p     q     r     f
True  True  True  True
True  True  False False
True  False True  True
True  False False False
False True  True  False
False True  False False
False False True  False
False False False True

Now you get: $(p \land q \land r) \lor (p \land \neg q \land r) \lor (\neg p \land \neg q \land \neg r)$
