Filter values using a formula

thekaoboy

New Member
Joined
Sep 7, 2006
Messages
48
Suppose I have the following data in Columns A and B:


Green 5
Red
Blue 32
Orange 12
Yellow
White 622

In a separate tab, I would like to create a list that returns only those data items that meet certain criteria (e.g., only nonblanks). So my list would skip Red and Yellow in my example.

It seems like a pretty straightforward formula but I can't figure it out.
Can anyone please help?

Thanks.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hello

try.
Excel Workbook
AB
1Green5
2Red
3Blue32
4Orange12
5Yellow
6White622
Sheet1
Excel 2010
Excel Workbook
AB
1Green4
2Blue
3Orange
4White
5
6
Sheet2
Excel 2010
Cell Formulas
RangeFormula
B1=COUNT(Sheet1!B1:B6)
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.

And copy the formula A1 down as far as you need.
 
Upvote 0
Suppose I have the following data in Columns A and B:


Green 5
Red
Blue 32
Orange 12
Yellow
White 622

In a separate tab, I would like to create a list that returns only those data items that meet certain criteria (e.g., only nonblanks). So my list would skip Red and Yellow in my example.

It seems like a pretty straightforward formula but I can't figure it out.
Can anyone please help?

Thanks.
Try this...

With your data...

Book1
AB
1ColorValues
2Green5
3Red_
4Blue32
5Orange12
6Yellow_
7White622
Sheet1


And the summary area on Sheet2...

Book1
AB
1CountColor
22Red
3_Yellow
4__
Sheet2

In the formulas I use the follwong defined named ranges:
  • Color
  • Refers to: =Sheet1!$A:$A
  • Values
  • REfers to: =Sheet1!$B$2:$B$7
Enter this formula in A2. This will return the count of records that meet the criteria.

=COUNTBLANK(Values)

Enter this array formula** in B2 and copy down until you get blanks.

=IF(ROWS(B$2:B2)>A$2,"",INDEX(Color,SMALL(IF(Values="",ROW(Values)),ROWS(B$2:B2))))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0
Thekaoboy,

Try the following (for only one worksheet).

Assuming your data is in the range A5:B10 in the worksheet Plan1, type the following in the cells indicated:

A1 - Column1
B1 - Column2
B2 - <>
A4 - Column1
B4 - Column2

Then do the following (for Excel 2003):

On the Data menu, point to Filter, and select Advanced Filter.
Then, type the following (in the indicated fields on the dialog box Advanced Filter):

List range: A4:B10
Criteria range: A1:B2
Copy to: F4

And mark the Select Box Copy to another local.

Finally, click OK.

For Excel 2007, do the following:

Click in Data tab, and, in the group Filter and Sort, click in Advanced.
Then, type the following (in the indicated fields on the dialog box Advanced Filter):

List range: A4:B10
Criteria range: A1:B2
Copy to: F4

And mark the Select Box Copy to another local.

Finally, click OK.

Markmzz
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top