+ Reply to Thread
Results 1 to 12 of 12

app script not working with only one sheet

  1. #1
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    app script not working with only one sheet

    I have this app script, it must give two date monthly and yearly. I have 3 sheets that I am using it on "Centus" "Plus" and "Bounty".
    I do not understand why it will not work on "Plus" as everything is the same as the two others.

    Sample sheet
    https://docs.google.com/spreadsheets...it?usp=sharing

    and getting this error.
    TypeError: Cannot read properties of undefined (reading 'getColumn')
    at calculateSumOnCellChange(Code:5:19)

    Please Login or Register  to view this content.
    Last edited by hendrikbez; 06-25-2023 at 11:06 PM. Reason: Solved

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: app script not working with only one sheet

    How are you running the script?

    are you running it yourself in the Apps Script editor?

    or do you have some kind of trigger setup?

    For others to be able to give relevant help you need to give clear and detailed description of the situation.
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  3. #3
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: app script not working with only one sheet

    Just for fun, i thought i would play with a copy of the file, and instead of using apps scripts to apply formulas (i dont know why you have taken this approach), i have written the following formulas.

    To test them out, make a copy of your file, then go to the Centus sheet, and clear out all of the following columns of all their formulas and headings:
    D, E, F, I, J, K, L, M, N, O.

    Then put these formulas into the respective columns headers (except columns M and N which are redundant)... but do NOT drag them down.. they will autopopulate the results.

    ={"C Totaal Munte";MAP(A2:A,B2:B,lambda(timestamp,amount,IF(timestamp="",,sum(B2:amount))))}

    ={"C $ totaal van munte";ARRAYFORMULA(IF(LEN(A2:A),D2:D*G2:G,))}

    ={"C $ Ontvang vandag";ARRAYFORMULA(IF(LEN(A2:A),B2:B*G2:G,))}

    ={"C $ per Maand";BYROW(A2:A,LAMBDA(timestamp,IF(LEN(timestamp),SUMIFS(F:F, ARRAYFORMULA(MONTH(A:A)), MONTH(timestamp)),)))}

    ={"C R Per Maand";ARRAYFORMULA(IF(LEN(A2:A),I2:I*GOOGLEFINANCE("CURRENCY:USDZAR"),))}

    ={"C $ Per Jaar";BYROW(A2:A,LAMBDA(timestamp,IF(LEN(timestamp),SUMIFS(F:F, ARRAYFORMULA(YEAR(A:A)), YEAR(timestamp)),)))}

    ={"C R Per Jaar";ARRAYFORMULA(IF(LEN(A2:A),K2:K*GOOGLEFINANCE("CURRENCY:USDZAR"),))}

    ={"C R toetaal";ARRAYFORMULA(IF(LEN(A2:A),E2:E*GOOGLEFINANCE("CURRENCY:USDZAR"),))}

  4. #4
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Hi janmorris,

    Thank you
    I will test this tomorrow, and let you know if this will work for me

  5. #5
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Hi janmorris

    Thank you, It is working

    I have used app script as someone told me to use it as thunkable will not werk with formulas that I needed in some column, but he was wrong, it is working 100%

    Can you explain only one to me , on what it do
    ={"C Totaal Munte";MAP(A2:A,B2:B,lambda(timestamp,amount,IF(timestamp="",,sum(B2:amount))))}
    Last edited by hendrikbez; 06-26-2023 at 02:27 AM.

  6. #6
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: app script not working with only one sheet

    Hi hendrikbaz,

    ={
    "C Totaal Munte" = the header
    ;
    MAP(A2:A,B2:B, = the arrays we want to treat by each row
    lambda(timestamp,amount, = the names we apply to the values in each row of the range
    IF(timestamp="",, = if the "timestamp" cell is blank, then be nothing
    sum(B2:amount) = else sum from B2 to the row of the current value of the "amount" (in column B)
    )))}

  7. #7
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Thank you.

    Just 1 question, if you can help me with this problem

    I have a google file with 12 sheets, and i cannot use thunkable for it, so I am using appsheet.

    But the USD to ZAR part is not working

    ={"C R Per Maand";ARRAYFORMULA(IF(LEN(A2:A),I2:I*GOOGLEFINANCE("CURRENCY:USDZAR"),))}

    It does not using GOOGLEFINANCE.

  8. #8
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: app script not working with only one sheet

    In my testing, the formula works.

    If you want help within the file then you will need to share a copy of it with editor access enabled so that we can look directly at the problem.

  9. #9
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Thank you, everything excepted the UAD/ZAR is not working on my side.

    https://www.appsheet.com/Template/Ap...share_app_link
    https://docs.google.com/spreadsheets...it?usp=sharing

  10. #10
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: app script not working with only one sheet

    The curent rate of USDZAR is 18.7671

    Attachment 835210

    Can you please explain how it is failing?

  11. #11
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Hi Janmorris

    Cannot see your attachment (invalid)

    When I add data in google sheet directly it is working, but when I try to add from appsheet it gives me this error ="COMPUTED_VALUE" in "j" "l" and "M"

  12. #12
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2021
    Posts
    311

    Re: app script not working with only one sheet

    Good morning janmorris

    I see it gives error now "#REF! Array result was not expanded because it would overwrite data in L3."

    ={"R Per Maand";ARRAYFORMULA(IF(LEN(B2:B),I2:I*GOOGLEFINANCE("CURRENCY:USDZAR"),))}

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Script not working as Expected
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2016, 09:01 PM
  2. VBA Script not working - Please help
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2016, 08:18 PM
  3. Formula in script not working
    By at22134 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2015, 09:30 AM
  4. [SOLVED] 'Insert New Row' VBA script working in one sheet, but not another
    By shaunguyver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2015, 06:10 AM
  5. VB script not working
    By ssschaar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2014, 03:28 PM
  6. This script isn't working, why not?
    By ledworld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 06:04 PM
  7. [SOLVED] my if-then-else script is not working
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2013, 02:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1