Excel formula help with multiple

Copper Contributor

Hi all,

 

I am trying to use a formula to make changes of selected list to be replaced with a common name. Example: If column G in the sample sheet contains information such as surgery and TB & Chest disease, I want the column E  value to be changed to "F" for all those cells that matches. Can anyone help me out?

 

Thanks Krish

3 Replies

@Krishck 

 

Like this?

 

@Subodh_Tiwari_sktneer Hi, I am noticing numerics in the column E, I cannot see any formula. Is that something to do with macros. As I am looking to change: 

If the department values are Surgery or TB & Chest disease, I want the region to be converted to F. Is there a formula for this pls or any query function.

 

 

So I can save that and instead change the information again and again, I can just hit refresh and the data gets updated. 

@Krishck 

It's a Power Query based solution not formulas. Cells can have either formulas or values.

To retain the values in one column and replace some of them based on some condition you need either a VBA approach or a Power Query approach to get the desired output.

 

What I did in your file, I converted your data on test_data sheet into an Official Excel Table and renamed it as Data and then I imported this data into the Power Query Editor and added a condition column along with few other steps and loaded the data back to a new sheet called "Sheet1".

 

If you click on Queries & Connections on Data Tab under Queries & Connections group, it would open the Queries & Connections pane on right side where you would find a query called "FinalData" and if you double click this query, the Power Query editor will be opened where you will find all the Applied Steps which were performed to get the desired data.

You can go through all those steps by clicking on them to see the transformation applied in each step.