I'm trying to populate an entire column in Google Sheets without the need to copy the formula to all the cells. I got part way there, but now I'm stuck with a #VALUE! error.
The formula I have already is:
=ArrayFormula(IF(ISBLANK($B4),,SUM(VLOOKUP(FLATTEN(SPLIT($B4, ", ")),$G3:$H8,2,FALSE))+$H$10))
I've shared the spreadsheet it relates to.
So this takes a cell with comma separated products in it, SPLITs it on the comma to give me a row of cells, and then FLATTENs it to make it a column of cells. With this I do a VLOOKUP to identify the price, but in order to get the price for all the products I need to add an ArrayFormula at this point. That's fine, so far so good, then I wrap the result in a SUM so I can get the order total, add an additional cell and wrap the whole thing in an IF to ensure it only runs when column B is populated.
That can be seen in the example spreadsheet in cell C4, but I want to populate the whole of column C using ArrayFormula so I don't need to copy the formula all the way down, so I made an attempt in column D by changing the references to a specific cell (B4) to a range (B4:B) and I just get a value error relating to the split now.
=ArrayFormula(IF(ISBLANK($B4:$B),,SUM(VLOOKUP(FLATTEN(SPLIT($B4:$B, ", ")),$G3:$H8,2,FALSE))+$H$10))
Am I meant to be nesting multiple ArrayFormula calls? I've tried a number of things without any joy. Am I missing something obvious, other than my understanding of how ArrayFormula works that is?
