Forum Discussion

Jammin2082's avatar
Jammin2082
Copper Contributor
Jul 21, 2022
Solved

Translating Morse code in Excel

Hi,

 

I am working on a Morse code translator in Excel with my son. I want to get rid of the FALSE messages in the cell. Can anyone help me?

 

In Morse code the dots are represented with "." and the dashes are represented with "\". The formula we have come up with is:

 

=IF(B3=".\","A",IF(B3="\...","B",IF(B3="\.\.","C",IF(B3="\..","D",IF(B3=".","E",IF(B3="..\.","F",IF(B3="\\.","G")))))))&IF(B3="….","H",IF(B3="..","I",IF(B3=".\\\","J",IF(B3="\.\","K",IF(B3=".\..","L",IF(B3="\\","M",IF(B3="\.","N")))))))&IF(B3="\\\","O",IF(B3=".\\.","P",IF(B3="\\.\","Q",IF(B3=".\.","R",IF(B3="…","S",IF(B3="\","T",IF(B3="..\","U")))))))&IF(B3="…\","V",IF(B3=".\\","W",IF(B3="\..\","X",IF(B3="\.\\","Y",IF(B3="\\..","Z")))))

  • Jammin2082 

    Perhaps

    =
    IF(B3=".\",    "A",
    IF(B3="\...",   "B",
    IF(B3="\.\.",   "C",
    IF(B3="\..",    "D",
    IF(B3=".",      "E",
    IF(B3="..\.",   "F",
    IF(B3="\\.",    "G",
    IF(B3="….",     "H",
    IF(B3="..",     "I",
    IF(B3=".\\\",   "J",
    IF(B3="\.\",    "K",
    IF(B3=".\..",   "L",
    IF(B3="\\",     "M",
    IF(B3="\.",     "N",
    IF(B3="\\\",    "O",
    IF(B3=".\\.",   "P",
    IF(B3="\\.\",   "Q",
    IF(B3=".\.",    "R",
    IF(B3="…",      "S",
    IF(B3="\",      "T",
    IF(B3="..\",    "U",
    IF(B3="…\",     "V",
    IF(B3=".\\",    "W",
    IF(B3="\..\",   "X",
    IF(B3="\.\\",   "Y",
    IF(B3="\\..",   "Z", "error")
    )))))))))))))))))))))))))

4 Replies

  • juliiephil's avatar
    juliiephil
    Copper Contributor

    Hi,

    I am working on a Morse code translator in Excel with my son. I want to get rid of the FALSE messages in the cell. Can anyone help me?

    In Morse code the dots are represented with "." and the dashes are represented with "\". The formula we have come up with is:

    =IF(B3=".\","A",IF(B3="\...","B",IF(B3="\.\.","C",IF(B3="\..","D",IF(B3=".","E",IF(B3="..\.","F",IF(B3="\\.","G")))))))&IF(B3="….","H",IF(B3="..","I",IF(B3=".\\\","J",IF(B3="\.\","K",IF(B3=".\..","L",IF(B3="\\","M",IF(B3="\.","N")))))))&IF(B3="\\\","O",IF(B3=".\\.","P",IF(B3="\\.\","Q",IF(B3=".\.","R",IF(B3="…","S",IF(B3="\","T",IF(B3="..\","U")))))))&IF(B3="…\","V",IF(B3=".\\","W",IF(B3="\..\","X",IF(B3="\.\\","Y",IF(B3="\\..","Z")))))

    I actually have the same question! I’m also trying to build a Morse code translator in Excel and keep running into the issue where the formula returns FALSE for some inputs. I’m curious if there’s a clean way to handle all the dots and dashes so the cell just stays blank or shows something else instead of FALSE. It’s tricky because nesting so many IF statements can get messy really fast.

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Jammin2082 

    Perhaps

    =
    IF(B3=".\",    "A",
    IF(B3="\...",   "B",
    IF(B3="\.\.",   "C",
    IF(B3="\..",    "D",
    IF(B3=".",      "E",
    IF(B3="..\.",   "F",
    IF(B3="\\.",    "G",
    IF(B3="….",     "H",
    IF(B3="..",     "I",
    IF(B3=".\\\",   "J",
    IF(B3="\.\",    "K",
    IF(B3=".\..",   "L",
    IF(B3="\\",     "M",
    IF(B3="\.",     "N",
    IF(B3="\\\",    "O",
    IF(B3=".\\.",   "P",
    IF(B3="\\.\",   "Q",
    IF(B3=".\.",    "R",
    IF(B3="…",      "S",
    IF(B3="\",      "T",
    IF(B3="..\",    "U",
    IF(B3="…\",     "V",
    IF(B3=".\\",    "W",
    IF(B3="\..\",   "X",
    IF(B3="\.\\",   "Y",
    IF(B3="\\..",   "Z", "error")
    )))))))))))))))))))))))))

Resources