During the period 23/12 to 6/1, we will have slightly longer response times than usual. Merry Christmas and a Happy New Year! 🎄✨

Excel challenge – FizzBuzz

Excel challenge – FizzBuzz


The rules are simple:

  • Count up from zero.
  • If the current number is a multiple of 3, say “Fizz” instead of the number
  • If it’s a multiple of 5, say “Buzz”
  • If it’s a multiple of both 3 and 5 say, “Fizzbuzz”

 


Write a formula for column C that plays the game of Fizzbuzz on the number sequence in column B.

*A multiple is a number that may be divided by another a certain number of times without a remainder

Post your solution in the comments below! 🙂


One thought on “Excel challenge – FizzBuzz

  1. First attempt, with IF-statements:
    =IF(AND(MOD(B3;3)=0;MOD(B3;5)=0);”Fizzbuzz”;IF(MOD(B3;3)=0;”Fizz”;IF(MOD(B3;5)=0;”Buzz”;B3)))

    Out of curiosity without IF-statements (and by chance a fascinating discovery (for me) of the mathematical approach – google “Euler’s fizzbuzz”)
    =SWITCH(MOD(B3^4;15);1;B3;6;”Fizz”;10;”Buzz”;0;”Fizzbuzz”)

Leave a Reply

You must be logged in to post a comment.

More blog posts

Tired of Googling?
Get the best Excel tips every week. Subscribe to our newsletter.

About the author

Emil har jobbat på Learnesy som produktutvecklare i flera år och ligger bakom flera av Learnesys kurser. Han har en utbildning inom datavetenskap med ett stort intresse för det analytiska och teoretiska. Utöver Finska och Svenska snackar Emil även flytande Excelfunktioner!