1
1

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 1 year has passed since last update.

スプレッドシート上でアスペクト比を計算したい時

Last updated at Posted at 2023-08-16

ECサイト改修の文脈で、競合サイトのトップページにあるバナーやスライダーエリアのアスペクト比を調べようと思い、スプレッドシートで使ったスクリプトをメモしておく。

スクリーンショット 2023-08-16 19.18.24.png

=IFERROR(ROUND((B2/GCD(B2,C2))/(C2/GCD(B2,C2)),1)&" : 1","")

この場合、B列に幅、C列に高さを記入して、高さを1と固定したアスペクト比を表示している。(バナーはだいたい横長であることが多いので)

関数名
IFERROR エラー時、エラーの代わりに指定した関数を表示
ROUND 四捨五入
GCD 最大公約数を取得
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?