It has the following strings: "apple > banana > carrot" and "bee>ant".
At this time, if there are more than two ">", I will return "banana > carrot"
If there is one ">", I want to return the entire string "bee>ant".
How can we solve this?

If(
Len(Label9.Text) - Len(Replace(Label9.Text, ">", "", 1)) >= 2,
Mid(Label9.Text, Find(">", Label9.Text, Find(">", Label9.Text) + 1) + 1),
Label9.Text
)
Switch(
Len(Label9.Text) - Len(Replace(Label9.Text, ">", "", 1)) >= 2,
Mid(Label9.Text, Find(">", Label9.Text, Find(">", Label9.Text) + 1) + 1),
Len(Label9.Text) - Len(Replace(Label9.Text, ">", "", 1)) < 2,
Label9.Text
)
Both codes experience errors.
The error in the first IF() code cannot convert the ">" value to a number
The error in the second switch() code is
Invalid argument found in switch statement, invalid argument format (Number). I need a boolean value