Extracting text from a field unless a character is a space

Hi there,

I’m looking for some help!
I have a formula in a cell that basically creates an automatic Project ID.
For this Project ID I use two fields:

  • A list of teams, which is formatted like “B – Brand” or “PM – Product Marketing”
  • Autonumber Field

I’m now using the following formula:
LEFT({Requesting Team:},2 ) & "-" & Autonumber

This formula is great, except for the fact that I am sometimes left with spaces:
The first Brand project becomes B -1
I would like for that to be B-1 (minus the space)

Any tips on how to achieve this?
Can I use LEN 2 unless the second character is a space, and then use LEN 1?

Thanks in advance!

Instead of setting 2 on LEFT, find the - position with FIND().