42
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

いつのまにかExcelでswitch文が使えるようになってた

Last updated at Posted at 2019-01-30

#前提
いつのまにかExcelでswitch文が使えるようになってた。

詳しくはOfficeサポート見てください!
https://support.office.com/ja-jp/article/switch-%E9%96%A2%E6%95%B0-47ab33c0-28ce-4530-8a45-d532ec4aa25e

#いつから使える?
Excel 2016(for Mac)以降

常に最新版を使わされるような下記のExcelはもちろん使えるようです。
for Office 365(for Mac)、for iPhone、for Android、etc.

#書式

=SWITCH(式,値1,結果1[,値2,結果2,…][,既定])

式の結果=値1 の場合、結果1を返却
[式の結果=値2 の場合、結果2を返却(以降、値127,結果127まで)]
[式の結果が上記に含まれない場合、既定を返却]

###例
=SWITCH(A1,1,"壱",2,"弐",3,"参",4,"四",5,"五","その他")

A1=1なら"壱"
A1=2なら"弐"
A1=3なら"三"
A1=4なら"四"
A1=5なら"五"
上記以外なら"その他"
が返却される

#感想
家のExcelが2013だった
ちなみに同じタイミングでSWITCH関数より便利そうなIFS関数とかいう便利なのも増えてるので覚えておくと良さそう!
https://support.office.com/ja-jp/article/IFS-%E9%96%A2%E6%95%B0-36329a26-37b2-467c-972b-4a39bd951d45

42
27
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?