{"id":17234,"date":"2025-01-21T19:00:07","date_gmt":"2025-01-21T10:00:07","guid":{"rendered":"https:\/\/84office.jp\/?p=17234"},"modified":"2025-01-21T19:00:08","modified_gmt":"2025-01-21T10:00:08","slug":"googlesheet-latitude-longitude-conversion","status":"publish","type":"post","link":"https:\/\/84office.jp\/en\/googlesheet-latitude-longitude-conversion\/","title":{"rendered":"3 Easy Ways to Convert Coordinates to DMS in Google Sheets"},"content":{"rendered":"<div class=\"codoc-evacuations\" style=\"display:none;\" data-shortcode=\"\"><\/div>\n<p>Have you ever found decimal format coordinates (e.g., 35.685085) hard to interpret?<\/p>\n\n\n\n<p>Converting them into Degrees, Minutes, and Seconds (DMS) format (e.g., 35\u00b0 41\u2032 6.31\u2033) can make the data much easier to read and simplify tasks like mapping or verifying location information.<\/p>\n\n\n\n<p>In this article, we\u2019ll explore <strong>3 methods to convert latitude and longitude into DMS format<\/strong> using Google Sheets:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Using formulas<\/strong><\/li>\n\n\n\n<li><strong>Creating a custom function<\/strong><\/li>\n\n\n\n<li><strong>Utilizing Google Apps Script (GAS)<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Choose the method that best suits your needs and data size!<\/p>\n\n\n<div class=\"swell-block-postLink u-mb-ctrl u-mb-60\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/513f3a0811e53a7de868b7f72fa4eb1d-1-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/en\/run-google-maps-api-geocoding\/\">How to Automatically Convert Addresses to Latitude and Longitude in Google Sheets Using Google Ma&#8230;<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">In the previous article, we introduced how to obtain an API key for using the Google Maps API. In this article, we will show you how to use the Google Maps A&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Comparison of Methods to Convert Latitude and Longitude to DMS Format<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table aligncenter u-mb-ctrl u-mb-40 is-all-centered--va is-thead-centered\"><table><thead style=\"--thead-color--bg:var(--color_pale02);--thead-color--txt:var(--swl-text_color--black)\"><tr><th>Method<\/th><th><strong>Features<\/strong><\/th><th><strong>Best Use Cases<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Formulas<\/strong><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Simple to use<\/span><br><span data-icon=\"dot\" class=\"swl-inline-list\">Requires input for each cell manually<\/span><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Ideal for quickly converting small datasets<\/span><br><span data-icon=\"dot\" class=\"swl-inline-list\">Suitable if you prefer not to use scripts<\/span><\/td><\/tr><tr><td><strong>Custom Functions<\/strong><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Easy to implement with a simple script<\/span><br><span data-icon=\"dot\" class=\"swl-inline-list\">Requires input for each cell<\/span><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Useful for repetitive tasks across multiple sheets<\/span><\/td><\/tr><tr><td><strong>Scripts<\/strong><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Capable of processing large datasets in one go<\/span><br><span data-icon=\"dot\" class=\"swl-inline-list\">Fully automated<\/span><\/td><td><span data-icon=\"dot\" class=\"swl-inline-list\">Efficient when dealing with large datasets<\/span><br><span data-icon=\"dot\" class=\"swl-inline-list\">Ideal for automating regular processing<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\"><strong>What is DMS Format?<\/strong><\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p class=\"u-mb-ctrl u-mb-30\">DMS (Degrees, Minutes, Seconds) is a format used to represent latitude and longitude as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Degrees (\u00b0):<\/strong> The integer part of the decimal value.<\/li>\n\n\n\n<li><strong>Minutes (\u2032):<\/strong> The decimal part of the degrees multiplied by 60, taking only the integer part.<\/li>\n\n\n\n<li class=\"u-mb-ctrl u-mb-30\"><strong>Seconds (\u2033):<\/strong> The decimal part of the minutes multiplied by 60.<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4f8b<\/strong>:<\/p>\n\n\n\n<p><strong>Decimal Format:<\/strong> 35.685085<\/p>\n\n\n\n<p><strong>DMS Format:<\/strong> 35\u00b0 41\u2032 6.31\u2033<\/p>\n<\/div><\/details>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Method 1: Converting to DMS Format Using Formulas<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"345\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75-1024x345.png\" alt=\"\" class=\"wp-image-17236\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75-1024x345.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75-300x101.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75-768x259.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75-1536x518.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-75.png 1992w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can easily convert latitude and longitude to DMS format using Google Sheets formulas.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Formulas<\/strong><\/h4>\n\n\n\n<p><strong>For Latitude<\/strong> (e.g., cell B2):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro u-mb-ctrl u-mb-40\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"=INT(B2) &amp; &quot;\u00b0 &quot; &amp; INT((B2-INT(B2))*60) &amp; &quot;\u2032 &quot; &amp; ROUND(((B2-INT(B2))*60-INT((B2-INT(B2))*60))*60, 2) &amp; &quot;\u2033&quot;\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F92672\">=<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(B2) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u00b0 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">((B2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(B2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2032 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">ROUND<\/span><span style=\"color: #F8F8F2\">(((B2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(B2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">((B2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(B2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2033&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>For Longitude<\/strong> (e.g., cell C2):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"=INT(C2) &amp; &quot;\u00b0 &quot; &amp; INT((C2-INT(C2))*60) &amp; &quot;\u2032 &quot; &amp; ROUND(((C2-INT(C2))*60-INT((C2-INT(C2))*60))*60, 2) &amp; &quot;\u2033&quot;\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F92672\">=<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(C2) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u00b0 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">((C2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(C2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2032 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">ROUND<\/span><span style=\"color: #F8F8F2\">(((C2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(C2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">((C2<\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #A6E22E\">INT<\/span><span style=\"color: #F8F8F2\">(C2))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">))<\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">&amp;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2033&quot;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-accordion u-mb-ctrl u-mb-60\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\"><strong>Explanation of the Formula<\/strong><\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p><code>INT<\/code>Function:Extracts the integer part of the number by discarding the decimal part.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>INT(B2)<\/code>: Retrieves the <strong>degrees (\u00b0)<\/strong>.<\/li>\n\n\n\n<li><code>(B2-INT(B2))*60<\/code>: Calculates the <strong>minutes (\u2032)<\/strong> by taking the decimal part of the degree (B2 &#8211; INT(B2)) and multiplying it by 60.<\/li>\n\n\n\n<li><code>((B2-INT(B2))*60-INT(...))*60<\/code>: Computes the <strong>seconds (\u2033)<\/strong> by taking the decimal part of the minutes and multiplying it by 60.<br>The <code>ROUND<\/code> function is used to round the result to <strong>2 decimal places<\/strong> for better readability.<\/li>\n<\/ul>\n<\/div><\/details>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Method 2: Converting to DMS Format Using a Custom Function<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"359\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81-1024x359.png\" alt=\"\" class=\"wp-image-17242\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81-1024x359.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81-300x105.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81-768x269.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81-1536x539.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-81.png 1796w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>By using a custom function, you can directly convert latitude and longitude into DMS format within Google Sheets cells. This method simplifies the process and makes your formulas more concise.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Custom Function Formulas<\/strong><\/h4>\n\n\n\n<p><strong>For Latitude<\/strong> (e.g., cell B2):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"=DMS(B2)\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F92672\">=<\/span><span style=\"color: #A6E22E\">DMS<\/span><span style=\"color: #F8F8F2\">(B2)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>For Longitude<\/strong> (e.g., cell C2):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro u-mb-ctrl u-mb-60\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"=DMS(C2)\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F92672\">=<\/span><span style=\"color: #A6E22E\">DMS<\/span><span style=\"color: #F8F8F2\">(C2)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Steps to Set Up the Custom Function<\/strong><\/h4>\n\n\n\n<p>To use a custom function, follow these steps:<\/p>\n\n\n\n<div class=\"swell-block-step u-mb-ctrl u-mb-60\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Open Apps Script Editor<\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"933\" height=\"591\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png\" alt=\"\" class=\"wp-image-16537\" style=\"width:447px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png 933w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-300x190.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-768x486.png 768w\" sizes=\"(max-width: 933px) 100vw, 933px\" \/><\/figure>\n<\/div>\n\n\n<p>Open a Google Spreadsheet and click on \u201c<strong>Extensions<\/strong>\u201d in the menu, then \u201c<strong>Apps Script<\/strong>\u201d to open the Apps Script editor.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Create the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png\" alt=\"\" class=\"wp-image-16191\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-300x138.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-768x354.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662.png 1387w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Since the default <code>function myFunction() {}<\/code> is present, delete it and replace it with the script below.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function DMS(value) {\n  const degrees = Math.floor(value); \/\/ Extract the degrees (\u00b0)\n  const minutes = Math.floor((value - degrees) * 60); \/\/ Calculate the minutes (\u2032)\n  const seconds = ((value - degrees) * 60 - minutes) * 60; \/\/ Calculate the seconds (\u2033)\n  return degrees + &quot;\u00b0 &quot; + minutes + &quot;\u2032 &quot; + seconds.toFixed(2) + &quot;\u2033&quot;; \/\/ Format the result as DMS\n}\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">DMS<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">value<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">(value); <\/span><span style=\"color: #88846F\">\/\/ Extract the degrees (\u00b0)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">); <\/span><span style=\"color: #88846F\">\/\/ Calculate the minutes (\u2032)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> seconds <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> ((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> minutes) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">; <\/span><span style=\"color: #88846F\">\/\/ Calculate the seconds (\u2033)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u00b0 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2032 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> seconds.<\/span><span style=\"color: #A6E22E\">toFixed<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2033&quot;<\/span><span style=\"color: #F8F8F2\">; <\/span><span style=\"color: #88846F\">\/\/ Format the result as DMS<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Script Description<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<dl class=\"swell-block-dl\">\n<dt class=\"swell-block-dl__dt\"><code>Math.floor(value)<\/code><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p>Retrieves the degrees (\u00b0) by truncating the decimal part.<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><code>(value - degrees) * 60<\/code><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p>Multiplies the decimal part by 60 to calculate the minutes (\u2032).<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><code>(minutes\u306e\u5c0f\u6570\u90e8\u5206 * 60)<\/code><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p>Calculates the seconds (\u2033) and rounds it to two decimal places.<\/p>\n<\/dd>\n<\/dl>\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Save the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"400\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76-1024x400.png\" alt=\"\" class=\"wp-image-17237\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76-1024x400.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76-300x117.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76-768x300.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76-1536x600.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-76.png 1578w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>After writing the script, give it a name and save it.<\/p>\n\n\n\n<p>Example: &#8220;Coordinates (DMS Format)&#8221;<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Run the Script<\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"400\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77-1024x400.png\" alt=\"\" class=\"wp-image-17238\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77-1024x400.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77-300x117.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77-768x300.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77-1536x600.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-77.png 1578w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Run the script once to authorize the required permissions.<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_memo u-mb-ctrl u-mb-60\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>If you&#8217;re running the script for the first time, you need to authorize it.<\/p>\n\n\n\n<p><strong>Therefore, press &#8220;<strong>Review Permissions.<\/strong>&#8220;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"882\" height=\"345\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png\" alt=\"\" class=\"wp-image-15938\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png 882w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-300x117.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-768x300.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><\/figure>\n<\/div>\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Detailed Authorization Steps<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p><strong>Press &#8220;Advanced.&#8221;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full u-mb-ctrl u-mb-50\"><img decoding=\"async\" width=\"1272\" height=\"688\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg\" alt=\"\" class=\"wp-image-15939\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg 1272w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-300x162.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-1024x554.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-768x415.jpg 768w\" sizes=\"(max-width: 1272px) 100vw, 1272px\" \/><\/figure>\n\n\n\n\n\n\n\n<p><strong>Press &#8220;Go to Untitled project (Unsafe).&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"1305\" height=\"893\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg\" alt=\"\" class=\"wp-image-15940\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg 1305w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-300x205.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-1024x701.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-768x526.jpg 768w\" sizes=\"(max-width: 1305px) 100vw, 1305px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>After that, press &#8220;Allow.&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"955\" height=\"543\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg\" alt=\"\" class=\"wp-image-15941\" style=\"width:566px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg 955w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-300x171.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-768x437.jpg 768w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/figure>\n<\/div>\n\n\n\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div>\n\n\n\n<p class=\"u-mb-ctrl u-mb-60\">Once the setup is complete, enter the custom function in a cell to use it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>Method 3: Bulk Conversion with Google Apps Script<\/strong><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1994\" height=\"557\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80.png\" alt=\"\" class=\"wp-image-17241\" style=\"width:852px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80.png 1994w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-300x84.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-1024x286.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-768x215.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-1536x429.png 1536w\" sizes=\"(max-width: 1994px) 100vw, 1994px\" \/><\/figure>\n\n\n\n<p>If you need to convert a large amount of data at once, using a script is the most efficient approach.<\/p>\n\n\n\n<p>The following script converts latitude (column B) and longitude (column C) into DMS format and outputs the results in columns D and E, respectively.<\/p>\n\n\n\n<p><strong>Key Features:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The original data in <strong>columns B (latitude)<\/strong> and <strong>C (longitude)<\/strong> remains unchanged.<\/li>\n\n\n\n<li><strong>Column D<\/strong>: Converted latitude (DMS format).<\/li>\n\n\n\n<li><strong>Column E<\/strong>: Converted longitude (DMS format).<\/li>\n\n\n\n<li>The script refers to a sheet named <strong>&#8220;GeoData&#8221;<\/strong> when executed.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Steps to Execute Google Apps Script<\/strong><\/h4>\n\n\n\n<div class=\"swell-block-step u-mb-ctrl u-mb-60\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Open Apps Script Editor<\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"933\" height=\"591\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png\" alt=\"\" class=\"wp-image-16537\" style=\"width:447px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d.png 933w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-300x190.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/12\/98efceb7a335447039dff05eb8d70d3d-768x486.png 768w\" sizes=\"(max-width: 933px) 100vw, 933px\" \/><\/figure>\n<\/div>\n\n\n<p>Open a Google Spreadsheet and click on \u201c<strong>Extensions<\/strong>\u201d in the menu, then \u201c<strong>Apps Script<\/strong>\u201d to open the Apps Script editor.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Create the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png\" alt=\"\" class=\"wp-image-16191\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-1024x472.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-300x138.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662-768x354.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/e5e524d3405a7a1c3cfaaf3f2b1cc662.png 1387w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Since the default <code>function myFunction() {}<\/code> is present, delete it and replace it with the script below.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function convertToDMS() {\n  \/\/ Get the sheet named &quot;GeoData&quot;\n  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;GeoData&quot;);\n  \n  \/\/ If the sheet does not exist, show an alert and stop execution\n  if (!sheet) {\n    SpreadsheetApp.getUi().alert('The sheet named &quot;GeoData&quot; was not found. Please check the sheet name.');\n    return;\n  }\n  \n  \/\/ Define the range for latitude (column B) and longitude (column C) starting from row 2\n  const range = sheet.getRange(2, 2, sheet.getLastRow() - 1, 2); \n  const values = range.getValues();\n\n  \/\/ Create an array to store the DMS format results for columns D and E\n  const output = values.map(row =&gt; {\n    const lat = row[0]; \/\/ Latitude\n    const lng = row[1]; \/\/ Longitude\n    return [\n      lat ? convert(lat) : &quot;&quot;, \/\/ Convert latitude to DMS (column D)\n      lng ? convert(lng) : &quot;&quot;  \/\/ Convert longitude to DMS (column E)\n    ];\n  });\n\n  \/\/ Write the results to columns D (4th column) and E (5th column)\n  sheet.getRange(2, 4, output.length, 2).setValues(output);\n}\n\n\/\/ Function to convert decimal format to DMS format\nfunction convert(value) {\n  const degrees = Math.floor(value); \/\/ Degrees (\u00b0)\n  const minutes = Math.floor((value - degrees) * 60); \/\/ Minutes (\u2032)\n  const seconds = ((value - degrees) * 60 - minutes) * 60; \/\/ Seconds (\u2033)\n  return degrees + &quot;\u00b0 &quot; + minutes + &quot;\u2032 &quot; + seconds.toFixed(2) + &quot;\u2033&quot;;\n}\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convertToDMS<\/span><span style=\"color: #F8F8F2\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Get the sheet named &quot;GeoData&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> sheet <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getActiveSpreadsheet<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getSheetByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;GeoData&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ If the sheet does not exist, show an alert and stop execution<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">if<\/span><span style=\"color: #F8F8F2\"> (<\/span><span style=\"color: #F92672\">!<\/span><span style=\"color: #F8F8F2\">sheet) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getUi<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">alert<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&#39;The sheet named &quot;GeoData&quot; was not found. Please check the sheet name.&#39;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Define the range for latitude (column B) and longitude (column C) starting from row 2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> range <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> sheet.<\/span><span style=\"color: #A6E22E\">getRange<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, sheet.<\/span><span style=\"color: #A6E22E\">getLastRow<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">); <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> values <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> range.<\/span><span style=\"color: #A6E22E\">getValues<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Create an array to store the DMS format results for columns D and E<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> output <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> values.<\/span><span style=\"color: #A6E22E\">map<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">row<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> lat <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">]; <\/span><span style=\"color: #88846F\">\/\/ Latitude<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> lng <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]; <\/span><span style=\"color: #88846F\">\/\/ Longitude<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      lat <\/span><span style=\"color: #F92672\">?<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(lat) <\/span><span style=\"color: #F92672\">:<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #88846F\">\/\/ Convert latitude to DMS (column D)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      lng <\/span><span style=\"color: #F92672\">?<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(lng) <\/span><span style=\"color: #F92672\">:<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Convert longitude to DMS (column E)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    ];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  });<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Write the results to columns D (4th column) and E (5th column)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  sheet.<\/span><span style=\"color: #A6E22E\">getRange<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">4<\/span><span style=\"color: #F8F8F2\">, output.length, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">setValues<\/span><span style=\"color: #F8F8F2\">(output);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #88846F\">\/\/ Function to convert decimal format to DMS format<\/span><\/span>\n<span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">value<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">(value); <\/span><span style=\"color: #88846F\">\/\/ Degrees (\u00b0)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">); <\/span><span style=\"color: #88846F\">\/\/ Minutes (\u2032)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> seconds <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> ((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> minutes) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">; <\/span><span style=\"color: #88846F\">\/\/ Seconds (\u2033)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u00b0 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2032 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> seconds.<\/span><span style=\"color: #A6E22E\">toFixed<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2033&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Script Description<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<dl class=\"swell-block-dl\">\n<dt class=\"swell-block-dl__dt\"><strong>Accessing the Sheet<\/strong><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;GeoData&quot;);\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> sheet <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> SpreadsheetApp.<\/span><span style=\"color: #A6E22E\">getActiveSpreadsheet<\/span><span style=\"color: #F8F8F2\">().<\/span><span style=\"color: #A6E22E\">getSheetByName<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #E6DB74\">&quot;GeoData&quot;<\/span><span style=\"color: #F8F8F2\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Specify the sheet name to retrieve the target sheet.<\/li>\n\n\n\n<li>If you need to use a different sheet, replace <code>'GeoData'<\/code> with the actual sheet name (e.g., <code>'Address List'<\/code>).<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><strong>Retrieving Data from the Sheet<\/strong><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const range = sheet.getRange(2, 2, sheet.getLastRow() - 1, 2); \n  const values = range.getValues();\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> range <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> sheet.<\/span><span style=\"color: #A6E22E\">getRange<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, sheet.<\/span><span style=\"color: #A6E22E\">getLastRow<\/span><span style=\"color: #F8F8F2\">() <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">); <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> values <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> range.<\/span><span style=\"color: #A6E22E\">getValues<\/span><span style=\"color: #F8F8F2\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>2, 2<\/code><\/strong>: Starts data retrieval from the 2nd row and the 2nd column (B column).<\/li>\n\n\n\n<li><strong><code>sheet.getLastRow() - 1<\/code><\/strong>: Calculates the number of rows to retrieve, from the 2nd row to the last row.<\/li>\n\n\n\n<li><strong><code>2<\/code><\/strong>: Retrieves data from two columns (B and C).<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><strong>Latitude and Longitude DMS Conversion<\/strong><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  const output = values.map(row =&gt; {\n    const lat = row[0]; \/\/ Latitude\n    const lng = row[1]; \/\/ Longitude\n    return [\n      lat ? convert(lat) : &quot;&quot;, \/\/ Convert latitude to DMS (column D)\n      lng ? convert(lng) : &quot;&quot;  \/\/ Convert longitude to DMS (column E)\n    ];\n  });\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> output <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> values.<\/span><span style=\"color: #A6E22E\">map<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">row<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #66D9EF; font-style: italic\">=&gt;<\/span><span style=\"color: #F8F8F2\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> lat <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row[<\/span><span style=\"color: #AE81FF\">0<\/span><span style=\"color: #F8F8F2\">]; <\/span><span style=\"color: #88846F\">\/\/ Latitude<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> lng <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> row[<\/span><span style=\"color: #AE81FF\">1<\/span><span style=\"color: #F8F8F2\">]; <\/span><span style=\"color: #88846F\">\/\/ Longitude<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> [<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      lat <\/span><span style=\"color: #F92672\">?<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(lat) <\/span><span style=\"color: #F92672\">:<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #88846F\">\/\/ Convert latitude to DMS (column D)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">      lng <\/span><span style=\"color: #F92672\">?<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(lng) <\/span><span style=\"color: #F92672\">:<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;&quot;<\/span><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #88846F\">\/\/ Convert longitude to DMS (column E)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">    ];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  });<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>map<\/code> function is used on each row of the <code>values<\/code> array to convert latitude and longitude into DMS format:<\/li>\n\n\n\n<li>If the latitude is empty, it returns a blank value (<code>\"\"<\/code>). Otherwise, it converts it to DMS format.<\/li>\n\n\n\n<li><strong>Latitude in DMS format<\/strong> \u2192 Output to <strong>column D<\/strong>.<\/li>\n\n\n\n<li><strong>Longitude in DMS format<\/strong> \u2192 Output to <strong>column E<\/strong>.<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><strong>Function for Converting to DMS Format<\/strong><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"function convert(value) {\n  const degrees = Math.floor(value); \/\/ Degrees (\u00b0)\n  const minutes = Math.floor((value - degrees) * 60); \/\/ Minutes (\u2032)\n  const seconds = ((value - degrees) * 60 - minutes) * 60; \/\/ Seconds (\u2033)\n  return degrees + &quot;\u00b0 &quot; + minutes + &quot;\u2032 &quot; + seconds.toFixed(2) + &quot;\u2033&quot;;\n}\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #66D9EF; font-style: italic\">function<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #A6E22E\">convert<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #FD971F; font-style: italic\">value<\/span><span style=\"color: #F8F8F2\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">(value); <\/span><span style=\"color: #88846F\">\/\/ Degrees (\u00b0)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> Math.<\/span><span style=\"color: #A6E22E\">floor<\/span><span style=\"color: #F8F8F2\">((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">); <\/span><span style=\"color: #88846F\">\/\/ Minutes (\u2032)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #66D9EF; font-style: italic\">const<\/span><span style=\"color: #F8F8F2\"> seconds <\/span><span style=\"color: #F92672\">=<\/span><span style=\"color: #F8F8F2\"> ((value <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> degrees) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">-<\/span><span style=\"color: #F8F8F2\"> minutes) <\/span><span style=\"color: #F92672\">*<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #AE81FF\">60<\/span><span style=\"color: #F8F8F2\">; <\/span><span style=\"color: #88846F\">\/\/ Seconds (\u2033)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">  <\/span><span style=\"color: #F92672\">return<\/span><span style=\"color: #F8F8F2\"> degrees <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u00b0 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> minutes <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2032 &quot;<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> seconds.<\/span><span style=\"color: #A6E22E\">toFixed<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">) <\/span><span style=\"color: #F92672\">+<\/span><span style=\"color: #F8F8F2\"> <\/span><span style=\"color: #E6DB74\">&quot;\u2033&quot;<\/span><span style=\"color: #F8F8F2\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F8F8F2\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This function converts latitude and longitude from decimal format to Degrees, Minutes, and Seconds (DMS) format:<\/li>\n\n\n\n<li><strong><code>Math.floor(value)<\/code><\/strong>: Extracts the degrees (\u00b0) by truncating the decimal part.<\/li>\n\n\n\n<li><strong><code>(value - degrees) * 60<\/code><\/strong>: Multiplies the decimal part by 60 to calculate the minutes (\u2032).<\/li>\n\n\n\n<li><strong><code>minutes' decimal part * 60<\/code><\/strong>: Calculates the seconds (\u2033) and rounds it to two decimal places.<\/li>\n\n\n\n<li><strong>Combine the result<\/strong>: Returns a formatted string like <code>35\u00b0 41\u2032 6.31\u2033<\/code>.<\/li>\n<\/ul>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\"><strong>Writing Results to Columns D and E<\/strong><\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"  sheet.getRange(2, 4, output.length, 2).setValues(output);\n\" style=\"color:#F8F8F2;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">  sheet.<\/span><span style=\"color: #A6E22E\">getRange<\/span><span style=\"color: #F8F8F2\">(<\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">, <\/span><span style=\"color: #AE81FF\">4<\/span><span style=\"color: #F8F8F2\">, output.length, <\/span><span style=\"color: #AE81FF\">2<\/span><span style=\"color: #F8F8F2\">).<\/span><span style=\"color: #A6E22E\">setValues<\/span><span style=\"color: #F8F8F2\">(output);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The converted DMS format results are written to <strong>column D (4th column)<\/strong> and <strong>column E (5th column)<\/strong>.<\/li>\n\n\n\n<li><strong><code>2<\/code><\/strong>: Specifies the starting row for the output (row 2).<\/li>\n\n\n\n<li><strong><code>4<\/code><\/strong>: Specifies the starting column for the output (column D).<\/li>\n\n\n\n<li><strong><code>output.length<\/code><\/strong>: Defines the number of rows to write, matching the number of rows in the input data.<\/li>\n\n\n\n<li><strong><code>2<\/code><\/strong>: Specifies the number of columns to write (D and E).<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Save the Script<\/strong><\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78-1024x465.png\" alt=\"\" class=\"wp-image-17239\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78-1024x465.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78-300x136.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78-768x349.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78-1536x697.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-78.png 1634w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>After writing the script, give it a name and save it.<\/p>\n\n\n\n<p><strong>Example:<\/strong> &#8220;GeoData-DMS&#8221;<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Run the Script<\/div><div class=\"swell-block-step__body\"><div class=\"wp-block-image u-mb-ctrl u-mb-40\">\n<figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79-1024x465.png\" alt=\"\" class=\"wp-image-17240\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79-1024x465.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79-300x136.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79-768x349.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79-1536x697.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-79.png 1634w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Run the script to convert the latitude and longitude in columns B and C into DMS format and output the results.<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_memo u-mb-ctrl u-mb-60\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>If you&#8217;re running the script for the first time, you need to authorize it.<\/p>\n\n\n\n<p><strong>Therefore, press &#8220;<strong>Review Permissions.<\/strong>&#8220;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"882\" height=\"345\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png\" alt=\"\" class=\"wp-image-15938\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79.png 882w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-300x117.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/image-79-768x300.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><\/figure>\n<\/div>\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">Detailed Authorization Steps<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p><strong>Press &#8220;Advanced.&#8221;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full u-mb-ctrl u-mb-50\"><img decoding=\"async\" width=\"1272\" height=\"688\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg\" alt=\"\" class=\"wp-image-15939\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d.jpg 1272w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-300x162.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-1024x554.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/188993dfac23ed4b35c326d75de2796d-768x415.jpg 768w\" sizes=\"(max-width: 1272px) 100vw, 1272px\" \/><\/figure>\n\n\n\n\n\n\n\n<p><strong>Press &#8220;Go to Untitled project (Unsafe).&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image u-mb-ctrl u-mb-50\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"1305\" height=\"893\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg\" alt=\"\" class=\"wp-image-15940\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9.jpg 1305w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-300x205.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-1024x701.jpg 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/b7775751f92380510b389302eaafe1b9-768x526.jpg 768w\" sizes=\"(max-width: 1305px) 100vw, 1305px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>After that, press &#8220;Allow.&#8221;<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" width=\"955\" height=\"543\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg\" alt=\"\" class=\"wp-image-15941\" style=\"width:566px;height:auto\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049.jpg 955w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-300x171.jpg 300w, https:\/\/84office.jp\/wp-content\/uploads\/2024\/11\/7ebb34b4d2c42fa532ad1c35c1ec1049-768x437.jpg 768w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/figure>\n<\/div>\n\n\n\n<\/div><\/details>\n<\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\"><strong>Latitude and Longitude (DMS Format) Output<\/strong><\/div><div class=\"swell-block-step__body\">\n<figure class=\"wp-block-image size-large u-mb-ctrl u-mb-40\"><img decoding=\"async\" width=\"1024\" height=\"286\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-1024x286.png\" alt=\"\" class=\"wp-image-17241\" srcset=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-1024x286.png 1024w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-300x84.png 300w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-768x215.png 768w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80-1536x429.png 1536w, https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/image-80.png 1994w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">The latitude and longitude in DMS format are batch-output to columns D and E.<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"u-mb-ctrl u-mb-30\">In this article, we introduced <strong>three methods<\/strong> to convert latitude and longitude into Degrees, Minutes, and Seconds (DMS) format:<\/p>\n\n\n\n<ul class=\"wp-block-list u-mb-ctrl u-mb-30 has-swl-pale-03-background-color has-background\">\n<li><strong>Formulas:<\/strong> Ideal for small datasets.<\/li>\n\n\n\n<li><strong>Custom Functions:<\/strong> Perfect if you want a reusable and easy-to-use function.<\/li>\n\n\n\n<li><strong>Google Apps Script:<\/strong> Best for processing large datasets in bulk.<\/li>\n<\/ul>\n\n\n\n<p class=\"u-mb-ctrl u-mb-40\">Choose the method that suits your needs and leverage these techniques to enhance your data management and streamline tasks in Google Sheets!<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/84office.jp\/wp-content\/uploads\/2025\/01\/513f3a0811e53a7de868b7f72fa4eb1d-1-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/84office.jp\/en\/run-google-maps-api-geocoding\/\">How to Automatically Convert Addresses to Latitude and Longitude in Google Sheets Using Google Ma&#8230;<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">In the previous article, we introduced how to obtain an API key for using the Google Maps API. In this article, we will show you how to use the Google Maps A&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n<div class=\"p-postListWrap\"><ul class=\"p-postList -type-simple\"><li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/gas-youtube-data-acquisition\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__body\">\n\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2024-12-21\" aria-label=\"\u516c\u958b\u65e5\">2024\u5e7412\u670821\u65e5<\/time><\/div>\n\t\t<span class=\"p-postList__cat u-thin icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t\t\t\t<\/div>\n\t\t\t<h2 class=\"p-postList__title\">How to Use the YouTube API to Fetch Video Data in Google Sheets: Automate with Google Apps Script!<\/h2>\t\t<\/div>\n\t<\/a>\n<\/li>\n<li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/google-sheets-ga4-linked-add-on\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__body\">\n\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2025-01-16\" aria-label=\"\u516c\u958b\u65e5\">2025\u5e741\u670816\u65e5<\/time><\/div>\n\t\t<span class=\"p-postList__cat u-thin icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t\t\t\t<\/div>\n\t\t\t<h2 class=\"p-postList__title\">How to Connect GA4 Data to Google Sheets: A Step-by-Step Guide Using the Official Google Analytics Add-On<\/h2>\t\t<\/div>\n\t<\/a>\n<\/li>\n<li class=\"p-postList__item\">\n\t<a href=\"https:\/\/84office.jp\/en\/googlesheet-latitude-longitude-conversion\/\" class=\"p-postList__link\">\n\t\t<div class=\"p-postList__body\">\n\t\t\t<div class=\"p-postList__meta\">\n\t\t\t\t<div class=\"p-postList__times c-postTimes u-thin\">\n\t<time class=\"c-postTimes__posted icon-posted\" datetime=\"2025-01-21\" aria-label=\"\u516c\u958b\u65e5\">2025\u5e741\u670821\u65e5<\/time><\/div>\n\t\t<span class=\"p-postList__cat u-thin icon-folder\" data-cat-id=\"12\">Google Sheets<\/span>\n\t\t\t\t<\/div>\n\t\t\t<h2 class=\"p-postList__title\">3 Easy Ways to Convert Coordinates to DMS in Google Sheets<\/h2>\t\t<\/div>\n\t<\/a>\n<\/li>\n<\/ul><\/div>\n\n\n<p class=\"is-style-emboss_box has-swl-pale-02-background-color has-background\">Our company offers support for improving work efficiency through the use of Google Apps Script. <br>If you need assistance with Google Apps Script customization or error resolution, please feel free to contact us. <br>We are fully committed to supporting your business improvements.<br><br><a href=\"https:\/\/84office.jp\/contact\/\">Contact us here<br><\/a><\/p>\n\n\n\n<script src=\"https:\/\/codoc.jp\/js\/cms.js\" data-css=\"rainbow\" data-usercode=\"pQLZofrBiA\" charset=\"UTF-8\" defer><\/script>\n <div id=\"codoc-entry-9lNr9PuMXQ\" class=\"codoc-entries\" data-without-body=\"1\" data-support-button-text=\"Support with a Tip\" data-support-message=\"We will keep offering tools and information to boost work efficiency. Your support helps us provide even better content.\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever found decimal format coordinates (e.g., 35.685085) hard to interpret? Converting them into Degre [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":17244,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_locale":"en_US","_original_post":"https:\/\/84office.jp\/?p=16725","footnotes":""},"categories":[12],"tags":[],"class_list":["post-17234","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12","en-US"],"_links":{"self":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/comments?post=17234"}],"version-history":[{"count":2,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17234\/revisions"}],"predecessor-version":[{"id":17243,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/posts\/17234\/revisions\/17243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/media\/17244"}],"wp:attachment":[{"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/media?parent=17234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/categories?post=17234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/84office.jp\/wp-json\/wp\/v2\/tags?post=17234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}