locked
Replace values with a condition RRS feed

  • Question

  • Hello everybody.

    I am trying to replace values in one column but only if where the value in another column has a specific value.

    For instance, I want to replace all "1" with blanks in column A but only if the value in column B is "REPLACE".

    Thanks in advance for any help!

    Thursday, June 18, 2015 4:03 PM

Answers

  • You need to create an additional column and use a formula such as 
     if [B]="REPLACE" and [A]="1" then "" else [A]

    then delete column [A] and rename the new column in "A"

    • Proposed as answer by Michael Amadi Friday, June 19, 2015 9:06 PM
    • Marked as answer by Michael Amadi Monday, August 10, 2015 10:21 PM
    Friday, June 19, 2015 8:08 PM

All replies

  • You need to create an additional column and use a formula such as 
     if [B]="REPLACE" and [A]="1" then "" else [A]

    then delete column [A] and rename the new column in "A"

    • Proposed as answer by Michael Amadi Friday, June 19, 2015 9:06 PM
    • Marked as answer by Michael Amadi Monday, August 10, 2015 10:21 PM
    Friday, June 19, 2015 8:08 PM
  • Thank you, I had already done that in Excel, once data was loaded. But I will try it in Power Query.
    Friday, June 19, 2015 8:15 PM