Extract Data from Single Cell based on multiple conditions

mohdamir1989

New Member
Joined
Oct 17, 2017
Messages
42
Dear All,

I have single cell having remarks of work done. I need to extract the data based on two conditions. I'm already using below formula which returns the word in cell but not fulfilling the condition I need.


Relay & Capacitor replaced

=IF(ISNUMBER(SEARCH("Relay",$T64)), "Relay", "")

It returns the relay, But I need it to output "relay" only if "replaced" is there in cell. as sometimes string is as below
Relay & Capacitor adjusted/missing

in such case it should not pick up "relay"

Your help in this regards is highly appreciated

Best Regards
M. Amir Waqas
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

You can your additional condition within if..

=IF(AND(ISNUMBER(SEARCH("Relay",$T64)), ISNUMBER(SEARCH("replaced",$T64))), "Relay", "")

Hope it works.
 
Upvote 0
Hi,

You can your additional condition within if..

=IF(AND(ISNUMBER(SEARCH("Relay",$T64)), ISNUMBER(SEARCH("replaced",$T64))), "Relay", "")

Hope it works.

:-D It is working perfectly. Thank so very much for kind and prompt response. Really appreciated.

I have number of such items in sheet on which implementing formula may slower down the performance of file. Is there any way I may implement this via VBA on day end and it paste the values and saves?

Best Regards
 
Upvote 0
This might be a better formula if you are looking for performance—fewer function calls and no IF():

=REPT("Relay",--ISNUMBER(SEARCH("Relay",$T64)*SEARCH("replaced",$T64)))
 
Upvote 0
This might be a better formula if you are looking for performance—fewer function calls and no IF():

=REPT("Relay",--ISNUMBER(SEARCH("Relay",$T64)*SEARCH("replaced",$T64)))

Thank you for simplifying it little furter. My file is of 25MBs now and I am using Excel 2007 on coure 2 duo machine which stucks many times.

I am looking for VBA which upon status change may run formula and paste values.

Note: I have no idea of VBA at all
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top