I’m trying to find a way to use sumproduct in excel but for only the records that begin with a certain character string.
Is there any way to make each range dependent upon a search criteria? So let’s say, only use records in BC:BC & BD:BD that have a corresponding record in BA:BA that begins with Stack. I don’t think you can use wildcards in sumproduct but is there another function I could be using?
You CAN do this using sumproduct… The trick is to use the
-- operator to change
0 and then you can multiply your other columns by that vector so as to get only the rows where your statement evaluates to true
To explain, the part
--(ISNUMBER(FIND("Stack",A:A))) basically says
If the word "Stack" exists in the cell in column A, evaluate to 1, otherwise, evaluate to 0 – Then you multiply by the values in
BD to get your final result.
You could make this formula more efficient / faster to calculate (if you’re using it A LOT in your sheet, by replacing, for example,
BC:BC to include the maximum number of rows you want, so, for example
BC1:BC1000 – Therefore not having to try and calculate it for the entire column.
Hope this helps!!
"begins with stack" specifically you can use
LEFT function, e.g.
where 5 corresponds to the length of the search term
As John Bustos says, better to restrict your ranges for
SUMPRODUCT – using the whole column may be slow