<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nandemo_excel</author_name>
  <author_url>https://blog.hatena.ne.jp/nandemo_excel/</author_url>
  <blog_title>なんでもエクセル（Nandemo Excel）</blog_title>
  <blog_url>https://nandemo-xl.hatenablog.com/</blog_url>
  <categories>
    <anon>数式／関数</anon>
  </categories>
  <description>勤続年数を「何年何ヶ月」と表示したいからと、DATEDIF関数の「Y」と「YM」で計算したものを「&amp;」で繋いで文字列で表現する人が時々います。 =DATEDIF(入社日,現在,&quot;Y&quot;)&amp;&quot;年&quot;&amp;DATEDIF(入社日,現在,&quot;YM&quot;)&amp;&quot;ヶ月&quot; やるのはいいんですけど、これをどうやって計算に使うつもりなんでしょう。 よくあるのは「職員の平均勤続年数を計算したい」みたいな話で、上のような表記にしてから「どうやって計算しようか」と悩み出す人がいます。とりあえず、その文字列から計算するのは止めときましょうか。 =DATEDIF(入社日,現在,&quot;M&quot;) 小学校で習ったと思いますが、計算する時は「単位を…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnandemo-xl.hatenablog.com%2Fentry%2F2023%2F10%2F30%2F092157&quot; title=&quot;数式/関数：年月表記の文字列を月単位表記に変換する - なんでもエクセル（Nandemo Excel）&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nandemo_excel/20231030/20231030091824.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-10-30 09:21:57</published>
  <title>数式/関数：年月表記の文字列を月単位表記に変換する</title>
  <type>rich</type>
  <url>https://nandemo-xl.hatenablog.com/entry/2023/10/30/092157</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
