Which are the parameters to use counta function?

Óscar Broullón Sotelo 0 Reputation points
2023-03-13T10:05:15.67+00:00

Hi,

I´m trying to use the function counta with Graph but i get a invalid argument error, there is not documentation about the parameters for this function, could you tell me how to use it?


{
    "error": {
        "code": "InvalidArgument",
        "message": "The argument is invalid or missing or has an incorrect format.",
        "innerError": {
            "code": "invalidArgument",
            "message": "The argument is invalid or missing or has an incorrect format.",
            "date": "2023-03-13T09:59:20",
            "request-id": "6e59c461-15e1-4bfd-a288-28c94ddadcca",
            "client-request-id": "6e59c461-15e1-4bfd-a288-28c94ddadcca"
        }
    }
}
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-03-13T12:52:15.6733333+00:00

    Hello Óscar Broullón Sotelo,

    Thanks for reaching out!

    As per the documentation, Error "InvalidArgument" usually occurs if the argument is invalid, missing or has an incorrect format. I am able to repro the issue after putting invalid Sheet Name in the request body.

    You can use the workbook functions in Excel with Microsoft Graph to invoke any workbook function by using the following syntax: POST /me/drive/root/workbook/functions/{function-name}. Please refer to the documentation for more details.

    I am able to use the function CountA using Microsoft Graph API. Please refer to the below screenshot:
    count_excel

    To use the function CountA with Microsoft Graph API, please refer to the below endpoint:

    POST https://graph.microsoft.com/v1.0/me/drive/root:/book1.xlsx:/workbook/functions/counta
    
    {
        "values": [
            {
                "address": "Sheet1!D1:D4"
            }
        ]
    }
    
    

    For a complete list of supported functions, see Excel.Functions class.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.