Google Sheets formula to convert my 5 cell lat 5 cell long to whatever google needs for maps - gps

I gathered 82 site coords during a soil test and wanted to map them, i entered them in individual cells, for example lat "38,49,41,638,N" is in 5 cells and "78,26,59,256,w" is in 5 more cells, what is the formula for converting these into whatever google sheets needs so i can use these with google maps in the reporting in google data studio, thanks.

I think I figure it out
=G2+(H1/60)+(I2+(J2/1000))/3600 & ",-" & uminus(L2+(M1/60)+(N2+(O2/1000))/3600)
returns
38.0106247222222,-78.01646
left to right is 4 cells for lat and 4 cells for long

Related

Sheets API Glitch rounds number to 15 Significant Figures (Gspread)

When I make a Cell Update of an 18 Digits Number (A User ID), it is rounded off to 15 significant figures(sf), leaving the last 3 digits as 000 and leaving the answer in Scientific Form.
Example: When i set Cell A1 to 847996733362936884 programmatically, it ends up in the spread sheet as 8.48E+17 or 847996733362936000 in the Formula Bar
I don't think there's a need for a picture as the description above is self explainable.
If someone can get me an explanation that would be great!!!
I'm using Gspread (Sheets API v4) and have made sure that any other components that may be a hindrance to this problem have been eliminated.

How to make "getValue()" working for me again

I have an existing google spreadsheet + script which was working perfectly. But suddenly stopped working since 1 week back.
In a sheet of my spreadsheet I am using the following command to download 200 days of historical stock prices:
=googlefinance(B1,ʺcloseʺ,today()-200,today()) ; //cell B1 contains the ticker symbol. It populates the values from cell B3 – B142
Now I have a script, in which I am first setting the value of cell B1. Wait for 10 seconds. Then I extract the value of a specific cell (containing a historical price).
var xyz = sheet.getRange('B100').getValues();
This line is not working. When I print the value of xyz it is always empty. However if I pull any other static value from the sheet, I get the value correctly. Any insights, very appreciated.
This is unfortunately not supported through the Sheets API or scripts. See https://gsuiteupdates.googleblog.com/2016/09/historical-googlefinance-data-no-longer.html for details.

How to do a summation only within specific cells via VBA

In reference to the picture below, I would like to loop through a certain column (Column D in this case) until I hit a specific cell (Yellow cells in this case). In my final spreadsheet I have multiple yellow cells that I would like to target. Once I hit a yellow cell, I would like to start a simple summation of the values one cell to the left of the yellow (Column C). I would like to keep summing the values until I hit a blank cell, which would indicate the end of the set.
Please let me know if you need any more clarification!
Here's some code that should get the job done. However you are going to have to adapt it to however you want to use it.
Dim Summation as Double
For Each Target in Range("D:D")
If Target.Interior.ColorValue = 6 Then
Summation = Summation + Target.Offset(0, -1).Value
End If
Next Target
I hope this helps. However, don't forget about FreeMan's suggestions about good question asking and using the macro recorder!

Getting a merged cell width on Google Spreadsheet API

I'm using the Google Spreadsheet API to convert a document containing workers shifts into event calendars.
The only problem is that shifts are represented by merged cells according to days and hours (with days and hours as rows and different work slots as cols), and when I read a certain cell, which is merged and spans over 6 cells, I cannot get the cells certain width or its merged area.
For example:
If I try to get the values between (4C:4E) I will get "Bob, , ," and not "bob,bob,bob", and I cannot even find a way to know how many cells "bob" take.
Do you guys know how can I know how many cells the merged one spread to? Or at least it's total width.
Thanks in advance!
Download from google drive as html, see:
Get FontStyle information from Google spreadsheet into appengine
Drive driveService = new Drive.Builder(TRANSPORT, JSON_FACTORY, credential).build();
File file = driveService.files().get(this.spreadsheetKey).execute();
String downloadUrl = file.getExportLinks().get("application/pdf");
downloadUrl = downloadUrl.replaceFirst("exportFormat=pdf", "exportFormat=html");
downloadUrl = appendWorksheetGid(downloadUrl); // adds "&gid="+sheetGid
HttpResponse resp =
driveService.getRequestFactory().buildGetRequest(new GenericUrl(downloadUrl))
.execute();
System.out.println("downloadUrl:"+downloadUrl);
InputStream fileContent = resp.getContent();
extractStyleFromHtml(fileContent,downloadUrl);
extractStyleFromHtml uses Jsoup - (Jsoup impressed me)
It's not possible via spreadsheet API. I was looking for same. Google admits the same in their documentation.
The literal value of the cell element is the calculated value of the
cell, without formatting applied. If the cell contains a formula, the
calculated value is given here. The Spreadsheets API has no concept of
formatting, and thus cannot manipulate formatting of cells.
Related question:
Set cell format in Google Sheets spreadsheet using its API & Python
One alternate way can be to download the doc in excel format programmatically. It will contain formatting information. Then using excel API to extract the info.

Linking cells in excel with a specific format

I am trying to link cells in excel on two different work sheets.
I am using the formula eg: cell1 = cell2 + cell3. The numbers that I have in cell2 and cell3 are in format of 100% (1) and 50% (2). I just want to add numbers 1 and 2 so that my cell1 will have number 3.
Is it possible to do without changing the cell formats?
Thanks a lot.
If you don't care about the percentages, just copy your column with the percentages and change the format of that column to value and in sheet 2, do addition on that column instead.
Unfortunately when a cell has a format of percentage and a user enters a number, it is converted into what it means given the context of the format. It's not like what is being displayed is wildly different than what is 'hidden' inside the cell. When you reformat a cell, that data is reformatted as well, so 50% becomes .5 even if you had originally entered 50 in the cell before changing it's format. Format is more than just 'display format' so maybe that's where the confusion is.
If you want to add the cells in the percentage row and not bother with reformatting the formula cell you can cheat and treat it as a string to get rid of that %. You could do =Left(A2+A3, Len(A2+A3)) that will give you the 1.5 answer without having to format te cell.
Not sure i understood your question but i'll give some elements:
formula and formats are separated in Excel, thus, you can set a formula in A1, say =A2+A3 but displays the value the way you wish
for instance, if A2 contains 100% and A3 contains 50%, then the result in A1 is worth 1.5
you can set the format of A1 the way you wish (Right-clic > Format cells > Number tab), for instance, decimal, the cell will then display 1.5 but if you choose percentage, the cell will then display 150%
Please elaborate your question if needed.
[EDIT] New answer thanks to your comment:
If i understand well, you want to sum up the values between brackets in your cell (whatever is before, event percentages in your case).
Then, you can try this in cell A3:
=MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1 )+MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1 )