Search code examples
google-sheetsconcatenationgoogle-sheets-formulaarray-formulasgoogle-sheets-query

Add the value of another cell in a complex formula


I found a complex formula that I am using but I want to edit it so it adds the value from another cell to the output.

See Sheet1 here:

https://docs.google.com/spreadsheets/d/1VrJEEVtYt1r4jPABpazQ31JVmotYF0LV3aroTHAcuq0/edit?usp=sharing

I need to edit the formula in cell D4 so it appends the result with the corresponding value from column B.


Solution

  • maybe:

    =ARRAYFORMULA(IF(C4:C="",,TRIM(TRANSPOSE(SPLIT(QUERY(
     REPT(Data!B5:B&"♠", Data!A2), ,999^99), "♠")))&"-"&B4:B))
    

    0