Formula to Find Items which Meet Criteria in Mult Columns

aggiedave05

New Member
Joined
Apr 11, 2006
Messages
10
OK...I have a list with 50+ columns. I want to go through each column and get a listing of records which meet a criteria. I realize I could make a filter each column individually to get these names and then copy/paste, but hoping to get something much faster.

For example if I want to get stores which meet sales of $10 or more for each period (Columns B, C, D)

A_____________B________C_______D
1 STORE 1_______12_______15_______8
2 STORE 2________6_______9_______10
3 STORE 3_______15_______9_______15

Then in B4 it would say STORE 1, STORE 2
C4 STORE 1
D4 STORE 2 STORE 3

Keep in mind I am doing this with 50+ columns and 700+ rows of data.

THANKS!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

mtb'r

New Member
Joined
Sep 8, 2006
Messages
42
Try this code:

Code:
Sub counting()
    Dim cols, i As Integer
    Dim t, cma As String
    
    cols = Application.WorksheetFunction.CountA(Range("1:1"))
    For i = 2 To cols
        For Each cl In Range(Cells(2, i), Cells(2, i).End(xlDown))
            If t <> "" Then
                cma = ", " 'for the first hit, don't use a comma separator
            Else
                cma = ""
            End If
            If cl.Value > 10 Then t = t & cma & Cells(cl.Row, 1)
        Next cl
        Cells(1, i).End(xlDown).Offset(1, 0) = t
        t = ""
    Next i
    
End Sub
 

Forum statistics

Threads
1,136,369
Messages
5,675,360
Members
419,565
Latest member
Phil57

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
Top