Show all rows until first field name equals Deletions

rki1966

Active Member
Joined
Feb 1, 2004
Messages
351
I have two columns: Index and Comments

I want to show the data until the first [Comments] = "DELETIONS"

I used this custom Column ([CommMatch]) to determine if Comments = 'DELETIONS"

= if [Comments] = "DELETIONS" then [Index] else "N")

I thought I could create a custom column (or filter) where Index is less than [CommMatch]. I can not figure out how to determine if each row index is less than the first index with a number.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I should have indicated that I am using Power Query. Please let me know if you need more information.

Additional Information

If "Comments" in row 11 = "DELETIONS" then the query would only return the first 10 rows


 
Last edited:
Upvote 0
Try this
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Pos = Table.PositionOf(Source,Table.First(Table.FindText(Source, "DELETIONS"))),
    Final = Table.FirstN(Source, Pos)
in
    Final
 
Upvote 0

Forum statistics

Threads
1,216,166
Messages
6,129,260
Members
449,497
Latest member
The Wamp

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