Solved

need help to write formula in Excel

Posted on 2011-09-12
10
278 Views
Last Modified: 2012-05-12
The attached Excel file is a simple example for my project with 10K rows.  "WEST ex CA" and "CENTRAL ex AR" in the drop down box is not working.  How to modify the formulas in G4-G9 to make them working?  Help needed!
sample.xls
0
Comment
Question by:jjxia2001
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Author Comment

by:jjxia2001
ID: 36526207
See the corrected samole file, I expect Cell I11 should change with the selection of the drop down.
sample.xls
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36526308
Try this formula in G4 copied down

=($N$2=1)+COUNTIF(INDEX($N$3:$N$7,$N$2),"*"&D4&"*")*(D4&" ex "&E4<>INDEX($N$3:$N$7,$N$2))

regards, barry
0
 
LVL 10

Expert Comment

by:SANTABABY
ID: 36526435
Use this formula for G4. Then copy G4 and paste in G5:G9.

=IF(OR($N$2=1,INDEX($N$3:$N$7,$N$2)=LEFT(D4 & " ex " & E4,LEN(INDEX($N$3:$N$7,$N$2)))),1,0)

0
 

Author Comment

by:jjxia2001
ID: 36526914
Thanks for the effort!  I forgot to mention that the real case is a little more complicated, some regions had to exclude more than one state, e.g :"WEST ex CA, AZ, WI".  Each region could have up to 15 states.  That is why I was struggling to use a formula to cover all of these.  
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36528432
Assuming all excluded states are listed in that format (separated by comma and space) then you can modify my suggestion as follows:

=($N$2=1)+COUNTIF(INDEX($N$3:$N$7,$N$2),D4&"*")*ISERR(SEARCH(" "&E4&",",INDEX($N$3:$N$7,$N$2)&","))

regards, barry
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 29

Expert Comment

by:gowflow
ID: 36528484
If you need more help pls advise
gowflow
0
 
LVL 29

Expert Comment

by:gowflow
ID: 36529077
Barry
Marvellous formulas learned a lot from trying it out !!!
gowflow
0
 

Author Comment

by:jjxia2001
ID: 36529466
Barry,  it's working perfectly!  Thanks so much!  Just one last question:  only one selection is "ALL ex CA, WI, AL, MN, CO".  I guess it can be added as a hard copy, such as if $N$2 = 2, if(or(E4<>"CA", E4<>"WI", E4<>"AL", E4<>"MN", E4<>"CO", then include all....  Can you help me on this?          
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36529694
Thanks gowflow

.....how about this version to modify for that last condition

=((LEFT(INDEX(N$3:N$7,N$2),3)="ALL")+COUNTIF(INDEX(N$3:N$7,N$2),D4&"*"))*ISERR(SEARCH(" "&E4&",",INDEX(N$3:N$7,N$2)&","))

regards, barry

0
 

Author Closing Comment

by:jjxia2001
ID: 36530369
perfect!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now