Excel Help - add prefix

Dolby

Honorary Master
Joined
Jan 31, 2005
Messages
39,122
Reaction score
6,138
I have a list of product SKUs (numerals) going down a column - like 1001, 1002, 1003 etc

However I need differentiate by adding the initials DB infront of each - so it reads DB.1001, DB.1002 etc Any way to automate that at all?

Thanks!
 
Is there an opposite to that ?

I now have DB.1001 ... but need to remove the DB part?
 
The opposite is a bit more complex, because you have to
1) find the position of a character/string with =FIND
2) and then select a partial string with =MID
 
Is there an opposite to that ?

I now have DB.1001 ... but need to remove the DB part?

Select the column where the data is in, ctrl-H (Replace) and replace the value (DB) with ""
No formula needed and don't have to worry about absolutes going wonky.
 
You can use Text-To-Columns option for that, use fixed width or text.
 
Is there an opposite to that ?

I now have DB.1001 ... but need to remove the DB part?

Can use the =MID function as long as the DB. is a constant prefix.
Something like =MID(ref cell,4,*4)
The *4 can be changed to be technically as long as you like, assuming the numbers get longer than 4 digits.
 
Can use the =MID function as long as the DB. is a constant prefix.
Something like =MID(ref cell,4,*4)
The *4 can be changed to be technically as long as you like, assuming the numbers get longer than 4 digits.

Can expand on this:

The equation below finds the fullstop "." in the value and then takes the value of anything after the "." . That way, it doesnt matter what is the prefix or the suffix, or their lengths, as long as there is "." somewhere in there.

To get the prefix : =MID(Cell#,1,FIND(".",Cell#)-1)

To get the suffix : =MID(Cell#,FIND(".",Cell#)+1,LEN(Cell#)-FIND(".",Cell#))

Replace all the 'Cell#' with the actual cell number where the value is e.g. A7
Then drag the formula down using the square in the bottom corner, and it will increment the cellnumber accordingly, so you can do it for the whole column/row
 
Or you could do custom formatting of the row or column and use the 'DB' as currency prefix...
 
The really simple option would just be "Find and replace".
Highlight the column you want to remove the prefix from, Ctrl - F, Replace, enter DB. in first field, leave second field blank...

But we like formulae :)
 
If you save as a csv, you can use an app called Csv'd, to add remove prefixes etc..
 
Top
Sign up to the MyBroadband newsletter
X