Hi I am trying to change values in Column B based on criteria met in Column A.
For example, I want Column B to update each row B where the first 3 letters in Column A are read as "REC"
and I want Column B to update each row S where the first 3 letters are read as "Pay"
Solved! Go to Solution.
Assuming you just want to populate the data from A into B you could try a formula tool using Column B as the output column:
if Left([Column A], 3) = "Rec" then [Column A]
elseif Left([Column A], 3) = "Pay" then [Column A]
else Null()
endif
I was about to post something but @AndrewS called it. As an alternative, you could use StartsWith([Column A], "Rec").
@TonyA - I forgot about StartsWith. I tend to stick to the old excel style formulas and I need to go beyond these.
@cambiukpytou_dup_420 To avoid a truncate warning, if FieldB is read in as only a string length of 1 you might need to add a select tool and set the length a bit higher to accommodate the new data.
Hi AndrewS
No i do not want to populate from A into B. I want data in B to be as
described based on conditions in Column A.
For example,
If Column A has the first 3 letters REC, then I want that same row item in
Column B to say "B".
If ColumnA has the first 3 letters Pay, then i want the same row item in
column B to say "S".
So then the formula was have a expression as
If StartsWith([Column A], "Rec"), then [Column B] = "B" ----?
Please imagine that Column B is actually blank. I left the B and S in there to show everyone what i want the output to look like.
Would this generate a B, for every Rec in column A?
You just need to change the original formula to:
if Left([Column A], 3) = "Rec" then "B"
elseif Left([Column A], 3) = "Pay" then "S"
else Null()
endif