SUBSTITUTE problem

Hi, i need to replace the notes of a long text with the next note. Example โ€œNto Re Re Miโ€ change to โ€œRe Mi Mi Faโ€.
i try
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
SUBSTITUTE(SUBSTITUTE(([transporto]);
โ€œNtoโ€;โ€œReโ€);
โ€œReโ€;โ€œMiโ€);
โ€œMiโ€;โ€œFaโ€);
โ€œFaโ€;โ€œSolโ€);
โ€œSolโ€;โ€œLaโ€);
โ€œLaโ€;โ€œSiโ€);
โ€œSiโ€;โ€œNtoโ€)
but it everything to Nto that is the last. Please help!!!

0 2 124
2 REPLIES 2

In nested substitutions you generally have to work backwards. So ABCD to BCDE you would start with D first and change that to E, then C to D etc. If this is more circular such as ABCD to BCDA then you would initially need to change D to something different like X and then at the end change X back to A

Example:
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE([transporto],โ€œNtoโ€,โ€œXXXโ€),โ€œSiโ€,โ€œNtoโ€),โ€œLaโ€,โ€œSiโ€),โ€œSolโ€,โ€œLaโ€),โ€œFaโ€,โ€œSolโ€),โ€œMiโ€,โ€œFaโ€),โ€œReโ€,โ€œMiโ€),โ€œXXXโ€,โ€œReโ€)

An additional option, is this is music(?), you could make the โ€œnoteโ€ a number and just add 1,2,3 etc if you need to make everything the next note. This way you can avoid all the headache of having to deal with a character based list and have a numerical list. You then just make a virtual column or make the number a reference to a note table that would translate 0=Nto 1=Re 2=Mi etc.
When you go over 7 you reset back to 0 with mod 7. I hope the concept makes sense there.

Top Labels in this Space