79760893

Date: 2025-09-10 13:13:23
Score: 0.5
Natty:
Report link

Okay, I see what's going on here. Your column has VLOOKUP formulas dragged down, so even the "empty" ones are returning an empty string (""), and Excel treats those as non-blank cells for counting purposes. That's why SUBTOTAL(3, ...) is counting everything with a formula, including the blanks. And your SUMPRODUCT attempt is skipping them all because every cell has a formula in it. Let's fix this step by step. I'm assuming you want to count the number of cells in that column (say, J5:J2000 based on your example) that actually have a value from the VLOOKUP (not just ""), and you want to use something like SUBTOTAL to respect any filters or hidden rows you might have.First, confirm your goal: If you're trying to sum the values instead of count them, let me know because that changes things (e.g., if it's numbers, SUBTOTAL(9, ...) might already work fine since "" gets treated as 0). But based on what you described, it sounds like a count of non-blank results. If the data from VLOOKUP is always numbers, we can use a simpler trick with SUBTOTAL(2, ...), which counts only numeric cells and ignores text like "". But if it's text or mixed, we'll need a different approach. For now, I'll give you a general solution that works for any data type.Here's how to set it up without a helper column, using a formula that combines SUMPRODUCT and SUBTOTAL to count only visible cells (ignoring filters) where the value isn't "".

  1. Pick the cell where you want this subtotal to go (probably below your data range or in a summary spot).

  2. Enter this formula, adjusting the range to match yours (I'm using J5:J2000 as an example, but swap in L5:L16282 if that's your actual column):=SUMPRODUCT(--(J5:J2000<>""), SUBTOTAL(3, OFFSET(J5, ROW(J5:J2000)-ROW(J5), 0)))Press Enter (or Ctrl+Shift+Enter if you're on an older Excel version that needs array formulas—most modern ones handle it automatically).

  3. What this does in simple terms:

    • The (J5:J2000<>"") part checks each cell to see if it's not an empty string, turning matches into 1s and non-matches into 0s.

    • The SUBTOTAL(3, OFFSET(...)) part creates an array of 1s for visible rows and 0s for hidden/filtered rows.

    • SUMPRODUCT multiplies them together and adds up the results, so you only count the visible cells that aren't "".

  4. Test it out: Apply a filter to your data (like on another column) to hide some rows, and watch the subtotal update automatically—it should only count the visible non-blank ones. If you have no filters, it'll just act like a smart COUNTIF that skips the "" cells.

If this feels a bit heavy for a huge range like 16,000 rows (it might calculate slowly), here's an alternative with a helper column, which is lighter on performance:

  1. Add a new column next to your data, say column K starting at K5.

  2. In K5, put: =IF(J5<>"", 1, "")

  3. Drag that formula down to match your range (all the way to K2000 or whatever).

  4. Now, in your subtotal cell, use: =SUBTOTAL(9, K5:K2000)

  5. This sums the 1s in the helper column, which effectively counts the non-"" cells in J, and SUBTOTAL(9) ignores any filtered rows. You can hide the helper column if it clutters things up.

If your VLOOKUP is always returning numbers (not text), reply and tell me—that lets us simplify to just =SUBTOTAL(2, J5:J2000), since it counts only numeric cells and skips "" (which is text).

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Ryan H