Show 3digits under Pairs

wd8ekd

Board Regular
Joined
Sep 12, 2008
Messages
64
A B C D E F
<table style="border-collapse: collapse; width: 387pt;" border="0" cellpadding="0" cellspacing="0" width="515"><col style="width: 54pt;" span="2" width="72"> <col style="width: 35pt;" width="46"> <col style="width: 41pt;" width="54"> <col style="width: 41pt;" width="55"> <col style="width: 54pt;" span="3" width="72"> <tbody><tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt; width: 54pt;" height="19" width="72">1
</td> <td style="width: 54pt;" width="72">
</td> <td style="width: 35pt;" width="46">
</td> <td class="xl64" style="width: 41pt;" align="right" width="54">12</td> <td class="xl63" style="width: 41pt;" align="right" width="55">66</td> <td class="xl64" style="width: 54pt;" align="right" width="72">18</td> <td style="width: 54pt;" width="72">
</td> <td style="width: 54pt;" width="72">
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">456</td> <td align="right">123</td> <td>
</td> <td align="right">129</td> <td align="right">667</td> <td align="right">481</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">667</td> <td align="right">234</td> <td>
</td> <td align="right">123</td> <td align="right">366</td> <td align="right">881</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">129</td> <td align="right">112</td> <td>
</td> <td align="right">112</td> <td>
</td> <td class="xl65"> 018
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">119</td> <td align="right">312</td> <td>
</td> <td align="right">312</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">222</td> <td align="right">113</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">354</td> <td align="right">223</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">690</td> <td align="right">567</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">980</td> <td align="right">366</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19"> 481</td> <td class="xl65"> 018
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" align="right" height="19">433</td> <td align="right">881</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td colspan="7" style="">Need formula ??? We have a pair of numbers in D1,E1,and F1…..</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td colspan="7" style="">We want only the numbers that have 12 from column A and B</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td colspan="3" style="">66 from column A and B</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td colspan="3" style="">18 from column A and B only</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td colspan="3" style="">Hope I explained it right…..</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td colspan="2" style="">Thank You</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 14.25pt;" height="19"> <td style="height: 14.25pt;" height="19">
</td> <td>Bob</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> </tbody></table>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Why is 481 & 881 included under the "18" column

Texasalynn

this is as far as I have got

Excel Workbook
ABCDEF
1***126618
2456123*129667481
3667234*123366881
4129112*112*018
5119312*312**
6222113****
7354223****
8690567****
9980366****
10481018****
11433881****
Sheet1


The yellow all contain "12" so they are included in the column - Just can figure out the 18??
 
Upvote 0
We really don't need the color....
And tried to put a example sheet on but why it won't work....
Don't know. Anyway do you have to use conditional formatting????
Some of the numbers got shifted over.....
Is there a formula to use or do you have to use conditional formatting???
bear with me cause we are slow here in excel....
 
Upvote 0
Ignore the colours - I just put them to highlight the examples.

Why is 481 & 881 being taken into the 18 column?
 
Upvote 0
Why is 481 & 881 included under the "18" column


Because they have 1 and 8 in them....
 
Upvote 0
so 218 would appear under the 12 column?
 
Upvote 0
How about 162 should that appear in the 12 column?
Code:
Sub matchnums()
Dim firstlookup  As String
Dim Secondlookup As String
Dim thirdlookup  As String
Dim Item As Range
'clears last data
Sheets("Sheet1").Range("D1", Sheets("Sheet1").Range("F65000")).ClearContents
'reads the three column headers - These can be changed on the sheet if required
firstlookup = Sheets("Sheet1").Range("D1").Value
Secondlookup = Sheets("Sheet1").Range("E1").Value
thirdlookup = Sheets("Sheet1").Range("F1").Value
'loops through each cell in columns A & B
For Each Item In Sheets("Sheet1").Range("A1", Sheets("Sheet1").Range("B65000").End(xlUp))
    If InStr(Item.Value, Left(firstlookup, 1)) Then
        If InStr(Item.Value, Right(firstlookup, 1)) Then
            Sheets("sheet1").Range("D65000").End(xlUp).Offset(1) = Item.Value
            
        End If
    End If
    If InStr(Item.Value, Left(Secondlookup, 1)) Then
        If InStr(Item.Value, Right(Secondlookup, 1)) Then
            Sheets("sheet1").Range("E65000").End(xlUp).Offset(1) = Item.Value
        End If
    End If
    If InStr(Item.Value, Left(thirdlookup, 1)) Then
        If InStr(Item.Value, Right(thirdlookup, 1)) Then
            Sheets("sheet1").Range("F65000").End(xlUp).Offset(1) = Item.Value
        End If
    End If
Next Item
End Sub


Right click the tab at the bottom - Click View code.

Paste all of the above from SUB ... to END SUB into the the Microsoft Excel Object called SHEET 1


When you want to run it press ALT+F8 then select matchnums & press Run.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

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