Solved

In the attached excel workbook, what code would I use to identify all rows that contain a number in column B?

Posted on 2014-03-04
11
279 Views
Last Modified: 2014-03-05
I have an excel file with the columns subject ID and diagnosis (about 3000 rows).

For each subject ID there are 5 diagnosis: MDE, Manic, Hypomanic, Mixed and Dysthymic.
I need to automate the identification of all subject IDs where at least one of the 5 diagnoses in column B is followed by a number.  Please see attached sample file. In the sample file, if at least of of the 5 diagnoses is followed by a number, I highlighted all five.
I would like to have code that would either highlight all five diagnosis for any subject where at least one of the five was followed by a number or copy and paste the subject ID and the data in the  adjacent cells in row B into another spread sheet as shown in the sample file (output sheet).
Thanks
LIFEchartee.xls
0
Comment
Question by:PDSWSS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39905530
You can enter this formula on row 2 of any blank column and copy it all the way down

=NOT(ISNA(MATCH($A2,IF(FIND(":",$B$2:$B$5000)<LEN($B$2:$B$5000),($A$2:$A$5000)),0)))

You can now filter on the True values
0
 
LVL 7

Expert Comment

by:Milind Koyande
ID: 39905537
Hello,

You can use conditional formatting to perform the task (please check the attached file).

I have used following Formula
==
=COUNTIF($A$2:$A$109,A2)>5
==

Also please refer : http://www.ozgrid.com/Excel/Formulas.htm for more help.

Thanks,
Milind MK
LIFEchartee-1.xls
0
 

Author Comment

by:PDSWSS
ID: 39906390
Hi Milind,

Thanks for your response. Not clear to me from the attached file how your solution works.
Where do you paste the formula?
And what is the meaning of the green highlighted Subjecxt IDs?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:PDSWSS
ID: 39906392
Saqib Husain, Syed:

Thanks for your solution. Appears to work perfectly.
I am waiting for a response from the other expert before I award points.
Thanks again
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39907329
Apparently he did not understand the requirement correctly. That solution is highlighting all items which have exactly 5 diagnoses. Less than 5 diagnoses is not highlighted.
0
 

Author Comment

by:PDSWSS
ID: 39907764
Your code highlighted all cells in the column that contained a number.You were close enough. Still solves my issue. Thanks
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39908486
My apologies. I forgot to mention that the formula is an ARRAY formula. Do you know how to enter an array formula?
0
 

Author Comment

by:PDSWSS
ID: 39908496
What I did worked - copied and pasted into C2, pressed enter and then clicked on the left bottom corner of the cell which filled the entire column with either False or True (in correct place).
0
 

Author Closing Comment

by:PDSWSS
ID: 39908498
Thanks again. Very helpful solution.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39908544
I still feel that you are missing the real result. Take a look at the formula same formula applied in both ways in the attached file.
LIFEchartee-2.xls
0
 

Author Comment

by:PDSWSS
ID: 39908555
Well your are correct.  This completely addresses my question.

Thanks for being so honorable.  PDSWSS
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

726 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