importgoogle-sheets-formuladelete-row

Need to remove the last row of an IMPORTHTL function where the # of rows changes?


New to the sheets/excel squad and have hit a wall that stackoverflow / reddit / other forums doesn't seem to answer!

Short Story: **IMPORTHTML will pull a table based on changing criteria, which means the table may sometimes have more or less columns. I need a way for the imported data to ALWAYS remove the last line of data, as the data in that row is messing with other formulas. **

Long Story: I have a table that is automatically updated with the top scoring leaders of whatever NHL team my team is facing. I have it pulling an IMPORTHTML based on the title text of the sheet. The text in the title cell will then cause cell P5 to generate the related URL to that team's skater stats, so it changes each match.

I have another function that pulls the number from a given column of that table, and the name in the adjacent Player Name column from another function (P5,"table",1).

The issue is every table has a "TOTAL" row, which will always be the Max number in any given column.

Instead of changing the range of the Max function every game, I'd like to ask if there is something i can wrap my IMPORTHTML function with that will wipe out the last row of any table.

I've tried different QUERY functions but there is no forumla or expression i can find that will allow that function to work the way i need. There is a formula that will remove the word "Total" from the IMPORTHTL table, but not the entire row of data.


Solution

  • You may try:

    =let(Σ,your_formula_goes_here,
         chooserows(Σ,sequence(rows(Σ)-1)))