SOLVED

Translating Morse code in Excel

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")))))

3 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@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")
)))))))))))))))))))))))))

@Sergei Baklan Brilliant. Thank you.

@Jammin2082 , you are welcome

1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@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")
)))))))))))))))))))))))))

View solution in original post