• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

returning multiple "true" values within 1 cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / returning multiple "true" values within 1 cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…returning multiple "true" values wi…
sp_PrintTopic sp_TopicIcon
returning multiple "true" values within 1 cell
Avatar
Chloe Cane

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 5, 2018
sp_UserOfflineSmall Offline
1
December 5, 2018 - 8:47 pm
sp_Permalink sp_Print

Hi Guys, 

 

I've successfully run the following formula;

=INDEX(COUNTRY,IF(SUMPRODUCT(ISNUMBER(SEARCH(COUNTRY,$Q10))*ROW('ALL DATA REFS'!$G$1:$G$216))<>0,SUMPRODUCT(ISNUMBER(SEARCH(COUNTRY,$Q10))*ROW('ALL DATA REFS'!$G$1:$G$216)),NA()))

I have a named list called "country" which contains all the country names I need, the formula then looks within my selected cell (Q10) and returns the matching country name in another cell - in the 1st attached image you can see it's returning Iceland - which is correct! 

In some circumstances there will be 2 or more countries listed in the cell, which using the above formula returns a #REF! (you can see in the second attached image) I assume because it has 2 results in the one cell. Is there any way to return both of those? If so how? Would it have to be done with an Array formula? 

If you could help me out I would massively appreciate it. 

Thank you!

formula-2.JPGImage Enlarger

formula-1.JPGImage Enlarger

Chloe 

sp_PlupAttachments Attachments
  • sp_PlupImage formula-2.JPG (30 KB)
  • sp_PlupImage formula-1.JPG (28 KB)
Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
2
December 6, 2018 - 12:01 am
sp_Permalink sp_Print

Hi Chloe

Please upload a sample copy of your file.

It will help us understand your needs better.

Sunny

Avatar
Chloe Cane

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 5, 2018
sp_UserOfflineSmall Offline
3
December 6, 2018 - 1:59 am
sp_Permalink sp_Print sp_EditHistory

hi there, here you go, let me know if it makes sense!

Thank you 🙂 

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
4
December 6, 2018 - 11:56 am
sp_Permalink sp_Print

Hi Chloe

You will need a macro for this.

See if this helps.

Sunny

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
5
December 6, 2018 - 1:42 pm
sp_Permalink sp_Print

Hi Chloe

This example uses a custom function.

Hope this helps

Sunny

Avatar
Chloe Cane

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 5, 2018
sp_UserOfflineSmall Offline
6
December 6, 2018 - 5:20 pm
sp_Permalink sp_Print

Hi Sunny, 

 

Firstly thank you for getting back to me I really appreciate it! So if I understand you correctly, in the attachment you've created a custom function called "findcountry"? is that by using a Macro? Apologies I dont know a lot about macros or making custom functions :s Just want to understand what you've done here 🙂 

 

thank you

 

Chloe 

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 648
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
7
December 6, 2018 - 10:08 pm
sp_Permalink sp_Print

If you have a version of Excel that has TEXTJOIN, you could use:

=TEXTJOIN(" ",TRUE,IF(COUNTIF(B7,"*"&COUNTRY&"*"),COUNTRY,""))

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
8
December 7, 2018 - 12:47 am
sp_Permalink sp_Print

Hi Chloe

Thanks for your feedback.

I used VBA (Visual Basic For Application), a programming language, to write both the macro and function..

I am unable to describe in detail here about VBA but you can search the Internet (or even in MOTH's blog) for it.

Regards

Sunny

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 215
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Ngoc Qui Nguyen
Clement Mansfield
Rose .
Bindu Menon
Baruch Zemer
Forum Stats:
Groups: 3
Forums: 24
Topics: 6352
Posts: 27779

 

Member Stats:
Guest Posters: 49
Members: 32319
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.