Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unkown Function returning #NAME? #504

Open
Rodrigoaz7 opened this issue Feb 17, 2018 · 5 comments
Open

Unkown Function returning #NAME? #504

Rodrigoaz7 opened this issue Feb 17, 2018 · 5 comments
Labels

Comments

@Rodrigoaz7
Copy link

Hello,

I was just using some lines of code like this one: wks.update_acell('A1', formula), and had worked fine. but now I'm using a different formula =googlefinance("petr3"; "price"; DIATRABALHO(HOJE();-10);HOJE()).
But the Sheet returnin the following error: "unkown function DIATRABALHO", but that function it's correct, even when I put the same formula directly into the sheet, it work fine.

What can I do this work just using update_acell ??

@burnash
Copy link
Owner

burnash commented Mar 11, 2018

Looks like it's a function with the localised name since it's missing in Google spreadsheets function list https://support.google.com/docs/table/25273?hl=en but present if I enable Portuguese.

I've just released a new version of gspread (2.0.0) which uses a newer version of Sheets API — v4. Try to update and run your code to see if it solves the issue.

@burnash burnash added the TTL label Mar 11, 2018
@Rodrigoaz7
Copy link
Author

i figure out the portuguese question, then I wrote all my functions in english and the data appears in my sheet, but when I do the request "worksheet.acell('A1').value" for example, it gives #NAME? and the others cells with data give a blank.

I already installed the version 2.0.0 of gspread but it gives the same problem. Can you help me on this?

Best regards,

@burnash
Copy link
Owner

burnash commented Mar 12, 2018

Sure, can you provide a more detailed example (step by step) of what you do?

@Rodrigoaz7
Copy link
Author

First, I get the credentials by the json_keyfile_name:

scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(BASE_DIR + 'path_of_json', scope)

Then I use the authorize:
gc = gspread.authorize(credentials, client_class=Client)

After the authorization, I open my sheet:
wks = gc.open("name_of_my_sheet").sheet1

Now comes the problem. First of all I update the cell 'A1" of my sheet with a function like this:
wks.update_acell('A1','=googlefinance("petr3";"price";workday(today();-10);today())')

And it worked, because in my sheet, the table with the data appears, but when a I run a code to get those datas with wks.acell('A1').value , it's given to me #NAME?.

And when a run the code like that with another cell, like wks.acell('B2').value, for example, it gives blank (but there's data in my sheet).

Best regards,

@lavigne958
Copy link
Collaborator

Hi @Rodrigoaz7, if you look at the following link, the error "#NAME" happens Chen your formula is not correct. See here error number 5 errors list

In your cas this is strange because you can see the values when opening your spreadsheet in a web browser.

Could provide some details, the exact formula you use? Are all functions in your formula accessible by gspread? Perhaps your formula access an other spreadsheets that gspread can't access?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants