Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-24-2018, 11:45 AM
zhead zhead is offline If or formula help Windows 7 64bit If or formula help Office 2010 64bit
Advanced Beginner
If or formula help
 
Join Date: Mar 2015
Location: Texas
Posts: 32
zhead is on a distinguished road
Default If or formula help

I have this formula =IF(OR(ISNUMBER(SEARCH("R102",A:A)),(ISNUMBER(SEAR CH("8505",A:A)))),"NSA", "")
It works great but I cannot seem to be able to add more criteria. I would like to be able to expand it quite a bit. I have tried creating a VBA statement but no luck
Reply With Quote
  #2  
Old 04-24-2018, 12:10 PM
xor xor is offline If or formula help Windows 10 If or formula help Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Please describe what you are trying to do.
Reply With Quote
  #3  
Old 04-24-2018, 12:13 PM
zhead zhead is offline If or formula help Windows 7 64bit If or formula help Office 2010 64bit
Advanced Beginner
If or formula help
 
Join Date: Mar 2015
Location: Texas
Posts: 32
zhead is on a distinguished road
Default

I want to insert NSA in column C cells if column A cells contain R102, 8500, 8501, 8502, 68 and others
Reply With Quote
  #4  
Old 04-24-2018, 01:08 PM
NBVC's Avatar
NBVC NBVC is offline If or formula help Windows 10 If or formula help Office 2013
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

You can create a table of values to look for off to the side then reference that list..

e.g

=IF(Isnumber(Match(A2,$Y$2:$Y$10,0)),"NSA","")

copied down

where Y2:Y10 contains the list of values to find in column A
Reply With Quote
  #5  
Old 04-24-2018, 01:52 PM
zhead zhead is offline If or formula help Windows 7 64bit If or formula help Office 2010 64bit
Advanced Beginner
If or formula help
 
Join Date: Mar 2015
Location: Texas
Posts: 32
zhead is on a distinguished road
Default

NBVC
Thanks that will work and very easy.
Reply With Quote
  #6  
Old 04-24-2018, 03:03 PM
zhead zhead is offline If or formula help Windows 7 64bit If or formula help Office 2010 64bit
Advanced Beginner
If or formula help
 
Join Date: Mar 2015
Location: Texas
Posts: 32
zhead is on a distinguished road
Default

Is it possible to combine these? If not no big deal. I will just use separate columns for the tables.

=IF(Isnumber(Match(A2,$Y$2:$Y$10,0)),"NSA","")+
=IF(Isnumber(Match(A2,$Z$2:$Z$10,0)),"MEAAP","")+
=IF(Isnumber(Match(A2,$AA$2:$AA$10,0)),"EUM","")
Reply With Quote
  #7  
Old 04-25-2018, 05:43 AM
NBVC's Avatar
NBVC NBVC is offline If or formula help Windows 10 If or formula help Office 2013
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

You can try this:

Add titles to Y1:AA1 (which are the same as results you want returned for the respective columns).. then use formula:

=IFERROR(INDEX($Y$1:$AA$1,SUMPRODUCT(($Y$2:$AA$5=$ A2)*((COLUMN($Y$2:$AA$5)-COLUMN($Y$2:$Y$5)+1)))),"")

copied down.

or if you only have 2 or three possibilies a simple nested if..

=IF(ISNUMBER(MATCH(A2,$Y$2:$Y$10,0)),"NSA",IF( ISNUMBER(MATCH(A2,$Z$2:$Z$10,0)),"MEEPA",IF( ISNUMBER(MATCH(A2,$AA$2:$AA$10,0)),"EUM","")))
Reply With Quote
  #8  
Old 04-25-2018, 06:19 AM
zhead zhead is offline If or formula help Windows 7 64bit If or formula help Office 2010 64bit
Advanced Beginner
If or formula help
 
Join Date: Mar 2015
Location: Texas
Posts: 32
zhead is on a distinguished road
Default

Awesome. the second formula is exactly what I needed. Thanks
Reply With Quote
  #9  
Old 04-25-2018, 07:09 AM
ArviLaanemets ArviLaanemets is offline If or formula help Windows 8 If or formula help Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

When the list of values to check is not too long, and you don't foresee a need to edit formula in future:
Code:
=IF(ISERROR(MATCH(A2,{"R102";"8500";"8501";"8502";"68"};0)),"","NSA")
Otherwise enter the list of check values into single-column table (may be on another - even hidden - sheet), and define the list range as Name. E.g. CheckVal. Now the formula will be:
Code:
=IF(ISERROR(MATCH(A2,CheckVal,0)),"","NSA")
and the length of check list is limited only by possible number of worksheet rows.

I'm not sure about array delimiter in 1st formula for US setings (is it comma or semicolon) - you have to check it yourself!

In case you need to return different values for different check lists, then VLOOKUP() is better solution.
Enter check list values and according return values into 2-column table (e.g. CheckValue, ReturnValue), and define table's datarange as Named Range (e.g. nCheckTable), or define the table as Table (Insert > Table), e.g. tCheckTable
The formula will be:
Code:
=IFERROR(VLOOKUP(A2,nCheckTable,2,0)),"")
or
Code:
=IFERROR(VLOOKUP(A2,tCheckTable,2,0)),"")
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Copy Row 2 Row But Next Column In Formula From Another Tab TimG Excel 3 04-16-2018 09:20 PM
Help with Formula Ragincajun22 Excel 1 08-24-2017 08:44 AM
If or formula help Possible to use an existing vlookup formula to also insert correct info and trigger a SUM formula innkeeper9 Excel 2 09-13-2016 08:59 PM
Need help with dragging a formula and changing a reference column as I drag the formula. LupeB Excel 1 10-22-2015 03:02 PM
Formula help furface00 Excel 10 02-26-2012 05:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft