Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a spreadsheet from which I need to select ONLY the first five rows in each category. Probably easier to see than describe....

enter image description here

I only want columns A and B when C is less than 5 -- =IF($C1>5,$A1,) and =IF($C1>5,$B1,) -- but I would like to exclude blank rows when $Cn is greater than 4.

I a perfect world, there would be a function that I could append as the "fail" condition, giving me this: `=IF($C1>5,$A1,[insert next instance of $An where $C1<5])

Any ideas on making this simple?

share|improve this question
2  
What version are you using? Have you tried using filters rather than formulas? –  CharlieRB Mar 13 '13 at 19:59
    
Excel 2010, and no, I've not tried filters. A project for this morning. :) –  dwwilson66 Mar 14 '13 at 11:17
add comment

2 Answers

up vote 1 down vote accepted

Insert a row below the category "I HAVE" and add column labels at the top of the column. Go to the Data tab and click Filter. This will add filter buttons to the column labels.

enter image description here

Click the drop down for the last column (I called it "Count"). Point to Number Filters and then Custom Filter. Select the first criteria to be Greater than and place a 0 in the next field. Leave And selected and then choose the criteria Less than in the next set. Place a 5 in the next field.

enter image description here

Click OK and it will filter out the rows which have a count of 0 and are less than 5. You will need to do the same thing for the other category of "I WANT".

share|improve this answer
add comment

Use Autofilter to show only rows with values less than 5.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.