Only show certain rows and the one immediately below

fuzzyjonclay

New Member
Joined
Jul 30, 2017
Messages
9
Hi everyone

I have a problem filtering out certain rows and wonder if someone could please help me.

The table below represents my spreadsheet. I have carried out an EXACT function to find cells underneath each other that are the same (e.g. David & David and Philip & Philip in ColumnB). This is represented by having TRUE in ColumnC on the first row of the matches.

What I would like to achieve is to only show the rows that have TRUE in ColumnC along with the row immediately below it. So, I would like to keep the 2 Davids and the 2 Philips, but get rid of the Sally and Sue rows.

ColumnAColumnBColumnC
100DavidTRUE
101DavidFALSE
102SallyFALSE
103PhilipTRUE
104PhilipFALSE
105SueFALSE

<tbody>
</tbody>

I hope this makes sense!

Many thanks for your help.

Jon
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi Jon

This is represented by having TRUE in ColumnC on the first row of the matches.

If I understand correctly you should have TRUE not just on the first row of the matches but on both rows of the matches.

You can then use autofilter and only display those rows.
 
Upvote 0
or with PowerQuery

Column1Column2Column1Column2
100​
David
100​
David
101​
David
101​
David
102​
Sally
103​
Philip
103​
Philip
104​
Philip
104​
Philip
105​
Sue

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Kept Duplicates" = let columnNames = {"Column2"}, addCount = Table.Group(Source, columnNames, {{"Count", Table.RowCount, type number}}), selectDuplicates = Table.SelectRows(addCount, each [Count] > 1), removeCount = Table.RemoveColumns(selectDuplicates, "Count") in Table.Join(Source, columnNames, removeCount, columnNames, JoinKind.Inner)
in
    #"Kept Duplicates"[/SIZE]
 
Upvote 0
Hi there.

You could make the formula in column C more complex, e.g. in C100 you would have: =IF(C99="TRUE","ALSO",your current formula here). This would put ALSO in the immediate row below, which you could filter on.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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