# Thread: Index/Match for Nonblanks Thanks: 0 Likes: 0

1. ## Index/Match for Nonblanks

Hello Everyone,
I'm designing a sheet that is to be used as a tally for a strawman poll before a real vote is held on some projects being considered at my company. Some of these polls will have comments on them when returned. I'd like to list all comments, though most will be blank with no comments.

I have attached a sample of the worksheet, but I cannot get my index/match (I am terrible at this formula base; vlookup is my comfort zone) to return all non-blanks, while ignoring the "Comments" header which is there to facilitate data entry.

Can anyone please help me with this, and maybe the logic of how to understand index/match going forward?

2. ## Re: Index/Match for Nonblanks

Hi,

See if this works for cell Q8

Code:
`=INDEX(E24:E323,MATCH(1,INDEX((E24:E323 <> "")*(ISERROR(SEARCH("Comments",E24:E323))),0,0),0))`

3. ## Re: Index/Match for Nonblanks

Originally Posted by Aryatect
Hi,

See if this works for cell Q8

Code:
`=INDEX(E24:E323,MATCH(1,INDEX((E24:E323 <> "")*(ISERROR(SEARCH("Comments",E24:E323))),0,0),0))`
Aryatect,
Thanks so much for your help! The formula in Q8 did pull the first comment, but did not continue pulling other comments below it. The formula simply kept returning the first comment only as I dragged the formula to Q9, Q10, etc. Thanks so much for the great start though, that's way more than I was getting.

4. ## Re: Index/Match for Nonblanks

Hi,

Try this

Code:
`=IFERROR(INDEX(\$E\$25:\$E\$325,AGGREGATE(15,6,(ROW(\$E\$25:\$E\$325)-ROW(\$E\$25)+1)/((MATCH(\$E\$25:\$E\$325,\$E\$25:\$E\$325,0)=ROW(\$E\$25:\$E\$325)-ROW(\$E\$25)+1)*(\$E\$25:\$E\$325 <> "")*(ISERROR(SEARCH("Comments",\$E\$25:\$E\$325)))),ROWS(Q\$8:Q8))),"")`
in Q8 and copy it down

5. ## Re: Index/Match for Nonblanks

Originally Posted by Aryatect
Hi,

Try this

Code:
`=IFERROR(INDEX(\$E\$25:\$E\$325,AGGREGATE(15,6,(ROW(\$E\$25:\$E\$325)-ROW(\$E\$25)+1)/((MATCH(\$E\$25:\$E\$325,\$E\$25:\$E\$325,0)=ROW(\$E\$25:\$E\$325)-ROW(\$E\$25)+1)*(\$E\$25:\$E\$325 <> "")*(ISERROR(SEARCH("Comments",\$E\$25:\$E\$325)))),ROWS(Q\$8:Q8))),"")`
in Q8 and copy it down
I can't thank you enough Aryatect. Do you recommend any resources to learn how to use this power?

6. ## Re: Index/Match for Nonblanks

I am a big fan of Mike "excelisfun" Girvin. He has a youtube channel by name "excelisfun" with lots of information.

7. ## Re: Index/Match for Nonblanks

Originally Posted by Aryatect

I am a big fan of Mike "excelisfun" Girvin. He has a youtube channel by name "excelisfun" with lots of information.
Thank you again, works perfectly!

8. ## Re: Index/Match for Nonblanks

Thank you for the feedback