I need help on differentiating Integers and Float values in Google Sheets. We are using Google Sheets API for collecting Spreadsheet's data.
When we have 2 columns containing integer values and float values respectively. The API returns their datatype as numberValue. I have attached image for reference below.
API response of a row with 1st column as Integer and 2nd column as Float
It will be very helpful for us if there is any way to differentiate integers and floats.
Thanks.
Related
In Google spreadsheets I use the following simple formula:
=QUERY({'pivot data source'!A:AN},"select * where Col1='2021-08' order by Col2")
This works fine so far. However, there is one comment column. It is empty for most rows. Now I added a comment there - it just won't appear in the result of the query formula.
I realized, that it works fine when the comment is a plain number. As soon as there is text, it won't show up.
As stated in the Google Help section for "query":
In case of mixed data types in a single column, the majority data type determines the data type of the column for query purposes. Minority data types are considered null values.
That means: As long as there are more values with numbers (numeric) than values with text (string), the rows with text will not show up. Even if there are as many numbers as text fields (e.g. one numeric value, one string), Google seems to define the column as numeric and strings don't show up.
To solve this problem, you can try to format the corresponding column in tab "pivot data source" as text (Format > Number > Plain text in the menu).
I have a product with In-App Purchases in several markets in which transactions happen in their local currency. Created a Google Sheet for the purpose of reporting revenues in our base currency (USD). I tried several things to create the most effective method to automatically read the currency pair for each transaction, but the formula isn't working.
I am attempting to accomplish 3 things here:
Create an array that will automatically convert different currencies to USD by using the GOOGLEFINANCE formula (see "G1" on the embedded spreadsheet).
Eliminating error when conversion finds a value having the same ISO codes (see "F12" on the embedded spreadsheet).
Calculating the transaction using the exchange rate of the day of the transaction instead of TODAY's exchange rate (no clue on how to do this without breaking the GOOGLEFINANCE formula).
Here is the formula I am using on Col "G" is:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E*GOOGLEFINANCE("CURRENCY:"&D2:D))}
The problem with this approach is that it replicates the value of cell "D2" down the whole array, instead of consecutive values from D2,3,4, etc, accordingly. Removing the "&" from the array breaks the formula.
While the formula used on Col "F" =E2*GOOGLEFINANCE("CURRENCY:"&D2) works, the problem here is that it has to be placed manually, row by row, and this is inefficient when dealing with thousands of records. Also, you will notice on cel F12, I get an invalid value because GoogleFinance cannot convert from dollars to dollars. The formula outputs an error. Is there a way to make the formula understand that when trying to convert a value with the same currency ISO's, the value stays the same?
Even while I get the correct calculation on approach #2, the data calculated is based on TODAY's exchange rate, however, I need that calculation based on the exchange rate of the same date of the transaction. Is this even possible?
The referred spreadsheet example is here: Google Finances Conversion Formula
GOOGLEFINANCE is not supported under ARRAYFORMULA
if your D2:D range is small you can do:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E5*{
GOOGLEFINANCE("CURRENCY:"&D2);
GOOGLEFINANCE("CURRENCY:"&D3);
GOOGLEFINANCE("CURRENCY:"&D4);
GOOGLEFINANCE("CURRENCY:"&D5)})}
I'm doing a very simple max function to find the max between 2 cells, it works on the first few lines, but doesn't work the rest of the way down.
You'll see in the pic the max functions are in column R and only find the max between cells in column P and Q.
What you can't see is Column P is data input manually, while column Q references a different cell that contains a formula.
Why is this not working? thanks
The issue with your ranges is that the values in range Q1:Q are NOT numbers.
Reading the official page about the MAX function:
Each value argument must be a cell, a number, or a range containing numbers. Cells without numbers or ranges are ignored. Entering text values will cause MAX to return the #VALUE! error. To allow text values, use MAXA.
Because they are not numbers they are considered as 0.
So, when using =max(P2,Q2) the result appears realistic.
But not always.
Do test your values using =ISNUMBER()
You can correct the formulas by formatting values as numbers.
Just using a value alone didn't work for me. Wrapping my range in an arrayformula with a nested value formula worked. For example:
=max(ArrayFormula((value($R2:$R))))
This is probably because my entire column is calculated using formulas. I had to apply the value formula to the entire array.
I have a Google sheet that I use multiple currencies in. I purchase a product on a specific date and I want to lock in the conversion for that date. However, I have not been able to do that with all the different formulas that I have tried. I keep getting an error. Here is the formula that I am using.
=J283*GOOGLEFINANCE("ZARCAD","price",date(2021,4,9),date(2021,4,11))
Column J is the column with the price in the currency of purchase. I need to convert it into Canadian dollars. It works if I want the current price of the currency, but not for the historical data.
The error is:
Error
Function MULTIPLY parameter 2 expects number values. But 'Date' is a text and cannot be coerced to a number.
How can I fix this issue?
The formula you are using creates a 2D array as below:
In order to be able to use a function that expects number values (like MULTIPLY), you have to index a part of the 2D array that is a number.
For example, to multiply the first "Close" value of 0.08575243, you have to tell the fomula to use that value for the calculation with the built-in INDEX function:
=INDEX(GOOGLEFINANCE("ZARCAD","price",date(2021,4,9),date(2021,4,11)),2,2)
If you wish to specify a different part of the array, just change the 2,2 (row, column) at the end to any numbers that point to the value in the array that you wish to use. Here, you can find the documentation for INDEX.
I'm trying to create a spreadsheet using Google Sheets.
One of the columns is for longitude values.
Another column is for lattitude values.
However, when I paste either longitude or latitude values into fields, the numeric strings are truncated.
Obviously sheets doesn't take long strings by default.
How can I configure Google Sheets to accept long numeric strings?
you can format it as Plain text and when you need to do math with it you just multiply the text string by 1 co convert it into a numeric value