Combined formula

Johnstone200

New Member
Joined
Apr 12, 2022
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am running a report and searching for key words in the spreadsheet that i recieve. I am searching for text within 3 colums (B, M and N) and i want to return the value in Z. I use an OR formula for W and an AND for X as i search for different text combinations. The formula used is as per below (the OR one).

However, for each formula i get the result in W and X for the number of times the word is seen - "no image" in this case. How can i run the formula to only show the result once. For example in this situation i only want to see LANE 2, and not repeated 3 times.

=IF(OR(ISNUMBER(SEARCH($AB$1,B2)),ISNUMBER(SEARCH($AC$1,B2)),ISNUMBER(SEARCH($AD$1,B2))),Z2,"")&IF(OR(ISNUMBER(SEARCH($AB$1,M2)),ISNUMBER(SEARCH($AC$1,M2)),ISNUMBER(SEARCH($AD$1,M2))),Z2,"")&IF(OR(ISNUMBER(SEARCH($AB$1,N2)),ISNUMBER(SEARCH($AC$1,N2)),ISNUMBER(SEARCH($AD$1,N2))),Z2,"")

Or is there a better way to write the formula?

BMNWXZno imageno imageno image
TRAYS COMING UP WITH NO IMAGEno imageTrays showing no image. LANE 2LANE 2LANE 2LANE 2LANE 2LANE 2LANE 2

Thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It may be that you need to give us a few more rows of sample data and expected results, but try this to see if it does what you want
Excel Formula:
=IF(COUNT(SEARCH(AB1:AD1,TEXTJOIN("|",1,B2&M2&N2))),Z2,"")

BTW, I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
 
Upvote 0
It may be that you need to give us a few more rows of sample data and expected results, but try this to see if it does what you want
Excel Formula:
=IF(COUNT(SEARCH(AB1:AD1,TEXTJOIN("|",1,B2&M2&N2))),Z2,"")

BTW, I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
Hello Peter, this works really well. The only question i have, if i am searching for a specific text string - say "RCU" in cells B, M & N as defined in cells AB1:AD1, i will still be returned the value of Z for any words that contain the letters RCU, for example "customer". How can i change this formula so it searches for exact text string?

PS - Working on a work computer so XL2BB is blocked :rolleyes:

If you could solve this last piece of the puzzle that would be great.


Thanks
Matt
 
Upvote 0
The only question i have, if i am searching for a specific text string - say "RCU" in cells B, M & N as defined in cells AB1:AD1, i will still be returned the value of Z for any words that contain the letters RCU, for example "customer". How can i change this formula so it searches for exact text string?
:oops: I had thought of that exact issue and hence introduced the TEXTJOIN function to my formula but forgot the corresponding change needed from "&" to commas.

See if this does what you want.
=IF(COUNT(SEARCH(AB1:AD1,TEXTJOIN("|",1,B2,M2,N2))),Z2,"")
 
Upvote 0
Solution
:oops: I had thought of that exact issue and hence introduced the TEXTJOIN function to my formula but forgot the corresponding change needed from "&" to commas.

See if this does what you want.
=IF(COUNT(SEARCH(AB1:AD1,TEXTJOIN("|",1,B2,M2,N2))),Z2,"")
Perfect, thank you so much for your assistance 👍
 
Upvote 0
You're welcome. Thanks for the follow-up. :)

BTW: The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

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