This article will show you how to build an Excel worksheet that automatically filters its results after you enter one or more criteria.
My original goal was to analyze 2016 keyword performance for one of my company’s PPC accounts. For example:
- Which keywords had more than 3 conversions and a CPL below $30?
- Which keywords had a CPL above $100 and an average position above 3?
- Which keywords had between 1 and 3 conversions, a CPL above $150, and an average position below 3?
Although this example applies the method to paid-search keyword analysis, once you understand it, applying it elsewhere or adding more filter criteria will not be difficult! I will walk through the implementation step by step below. Download the file here!
Step One: Raw Data

The starting data looks perfectly ordinary, just like a typical export from AdWords or another tool. Because this was work-related, I replaced the real keywords, ad groups, and campaigns with other content~
(The client was a company in mainland China… so I used Simplified Chinese. Please excuse that!)
Step Two: Choose the Filter Criteria
Here, you need to think about how dividing the data would make the analysis useful. Some people may want to filter by CTR, while others may want to filter by time; there is no absolute right or wrong answer.I chose website conversions, CPL, and position as the basis for my filters!
Step Three: Create Helper Column I
We need three helper columns to produce the result we want. The first helper column assigns a numeric ID to every keyword using this formula:=ROWS($M$9:M9)

Step Four: Create Helper Column II*
Helper Column II is our criteria column, and it is the most important one.We will begin with a simple condition. After confirming that it works, we will return and make the criteria more sophisticated.
The formula in N9 is:
=IF(J9>=$S$4,M9,"")
The image above shows that when website conversions are greater than or equal to our chosen threshold, Helper Column II returns that keyword’s ID from Helper Column I. If we change S4 to 2, only keyword ID 1292 remains in Helper Column II.
Step Five: Create Helper Column III
The purpose of Helper Column III is to remove all the blank cells in Helper Column II, leaving only the IDs of keywords that meet the condition (more than 1 website conversion). The formula is:=IFERROR(SMALL($N$9:$N$3449,M9),"")
If you already know the basics of Excel, you may have guessed the next step by now! The purpose of these three helper columns is to identify the rows containing every keyword that meets the criteria. The idea is the same as INDEX+MATCH: once we know which row each result is in, the dynamic table can use INDEX to retrieve the data.
Step Six: The Dynamic Table!
In this step, we build the final table that will be displayed. The formula uses INDEX, treating the source data as one large array, while HELPER3 lists the matching keywords one by one.=INDEX($B$9:$O$3449,$O9,COLUMNS($R$9:R9))
- $B$9:$O$3449 is the range containing all the source data, including the three helper columns.
- $O9 is the number in Helper Column III—in other words, the row within this range that contains a keyword matching our criteria. We lock column O so that when we drag the formula to the right, it still looks only at the value in O, while dragging it down moves to the next matching keyword, and so on.
- COLUMNS($R$9:R9) uses the same idea as Helper Column I. After we drag the formula to the right, column S displays Ad Group, T displays Campaign, U displays Impressions, and so on.

Finally, if INDEX does not find anything because the value that HELPER3 is looking for is blank, it returns an ugly #VALUE! error. We therefore wrap it in IFERROR so that the formula returns “” when INDEX finds nothing. The final formula is:
=IFERROR(INDEX($B$9:$O$3449,$O9,COLUMNS($R$9:R9)),"")
Step Six: Add More Filter Criteria
At this point, our dynamic worksheet is complete, but it can currently evaluate only one “condition”: it can select only website conversions greater than or equal to the number in S4. That is not especially useful, so we need to return to Helper Column II and enhance its formula so that it can evaluate multiple conditions at once.=IF(J9>=$S$4,M9,"")
AND
Suppose we want to filter for results with at least 2 but fewer than 4 website conversions. The formula in Helper Column II becomes the following. Only when both J9>=$S$4 and J9<$S$5 are true does the IF formula return M9; otherwise, it returns a blank (“”).
=IF(AND(J9>=$S$4,J9<$S$5),M9,"")
OR
The formula above has a small bug. When no value is entered in S5, the number in column J will always be greater than the blank cell (""). Suppose a keyword has 3 conversions, we enter 2 in S4, and leave S5 blank. AND(3>=S4,3<S5) returns FALSE because the conversions column (J) in the source data always contains a number (0, 1, 2, 3, 4, and so on), and a number will always be considered greater than a blank cell.To avoid this result, we can make the formula above slightly more complex:
=IF(AND(J9>=$S$4,OR(J9<$S$5,$S$5=""),M9,"")
Mix
Once we know how to use AND and OR, we can add as many comparison criteria as we want. At the beginning of the article, I selected three values to compare, so the final formula in Helper Column II becomes:=IF(AND(J9>=$S$4,OR(J9<$S$5,$S$5=""),K9>=$T$4,OR(K9<$T$5,$T$5=""),L9>$U$4,OR(L9<$U$5,$U$5="")),M9,"")
Step Seven: A Few Simple Improvements
That brings the main work to an end. Everything left is just a matter of simple refinement and appearance. You can hide columns A through O because users do not need to see them.You can also add a “count” at the top so that users can clearly see how many keywords meet the selected criteria. The formula is:
=COUNTIF(R9:R3449,"?*")







