Search code examples
google-sheetsgoogle-sheets-formulavalueerror

IMPORTRANGE #VALUE! error in google sheets


I have 2 spreadsheets, and I want to pull the cells in the 1st one to the 2nd. I wrote a QUERY to filter columns and get the total profit values with SUM(), but when I imported the needed cells with calculated values into another spreadsheet using IMPORTRANGE, it gave a #VALUE! error. Are there any ways to import them, so that when the values change in the 1st spreadsheet, it will automatically change in the 2nd one as well? Attached screenshots below, queries are written in the 'sum' cells

enter image description here

enter image description here


Solution

  • To the first option you can use FILTER, and for the second SUBTOTAL. For the first something like: =LAMBDA(q,SUM(FILTER (INDEX(q,,16),INDEX(q,,4)<>"Cancelled",Month(INDEX(q,,2))=2)))(IMPORTRANGE(...)) changing the value inside INDEX to the column you're applying the filters to. And with Subtotal try with =SUBTOTAL(109,D:D)

    I suggest you upload more information for a more specific answer