View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Vic Vic is offline
external usenet poster
 
Posts: 117
Default Concatenation based on conditions

I need to concatenate 3 cells (A1, B1 & E1) into one (G1) and change some
values while doing this.
If A1 = 5, I need G1 have B1 (4-digit value with leading zeroes) and A1 as
005 (3 digits with leading zeroes) like this 0131005.
Not done yet.
if E1 has a value of "CYCLE 3", I need to abbreviate and put "C03" at the
end of G1 (0131005C03). I may have up to 99 cycles, each cycle needs to be
abbreviated as C plus 2 digits of that cycle.
If E1 has a value of "END OF TREAT" I need to put "EOT" at the end of G1
(0131005EOT).
If E1 has value of "SCREENING" I need to put "PRS" at the of G1 (0131005PRS).
The value of G1 should look like this:
B1 A1 and E1 (EOT or PRS or C01 or C02 or C...) 10 positions in total.
1011008C03: B1=1011, A1=8, E1= CYCLE 3

Can anyone help me to get this done?

Thank you