I have three columns of data in columns K, M and O in a Google Spreadsheet and want to find out (with results printed in column H) which values are common to each of K,M and O.

To make it simpler, I tried to compare two columns K and M with this formula

```
=ARRAYFORMULA((IFERROR(MATCH(K1:K,M1:M,0),0)))
```

The problem with the results was that it printed (in column H) the number of the row in column M where the value in column K is located. I'd just rather have the value printed in column H rather than a number telling me where to find the value in column M, so there's that problem, and then that only works for two columns. Also, for a comparison of three columns to work, it can't print a number telling me where to find a value because it'd have to print two numbers (one for each of the other two columns), so I need the value printed. How can I add a third column into here?

Note, I wasn't sure about where to ask this type of question, however, I found this answer below saying that Excel "formula" questions can be asked here, so I assumed the same for Google Spreadsheets. I tagged this question as Excel as well because I think many of the basic formulas are the same

Update

I think this might be complex with three columns, so if you can show me how to do it with two columns P and Q, I can compare the results of that formula with column R and in that way find the common values in all three columns. However, for that to work, the comparison of two columns has to print the matching value in a new column so that new column can be compared with the third column