Forum Discussion

wcstarks's avatar
wcstarks
Iron Contributor
Feb 10, 2023

Print for a date range

I would like a feature that I can use ad hoc that will let me do a standard print of my worksheet table for a date range that I specify for each print request. Is that doable?
  • mathetes's avatar
    mathetes
    Feb 28, 2023

    wcstarks 

     

    If you've gotten rid of that top row that had only a few formulas in it, as well as both rows at the bottom that were not true data rows, then the formula below should work, and keep up with new rows at the top. However, I think you'll find that it works best to insert the new row just above row 3, not at the very top.  At the very top, it will format itself based on the header row above, which you don't want to have happen.

     

    This formula goes in cell A5 of the "Prt Date Rng" tab

    =FILTER(tblQ1,(tblQ1[Date]>=Start)*(tblQ1[Date]<=Finish),"No Rows")

     

    What you'll see there is that it no longer refers to the cell addresses, but rather to the table by name and the Date column by name.

     

    Note: I've attached a slightly updated version of the older workbook, with the table modified (and an empty row waiting for you) and the new formula.

     

    Regarding the $ symbol in a cell reference ( $A$3, $A3, A$3 😞 What these do, and it's significant, is to render the letter or the number (the column or the row reference, respectively) absolute rather than relative. Which means, as you copy a formula elsewhere, the parts of a cell reference that are absolute don't change, where the relative ones do, relative to the new cell. Here's a more complete description of how that works.

Resources