VBA code or formula needed to identify certain records in a database

  • Thread starter Thread starter Paul Simon
  • Start date Start date
P

Paul Simon

I'm drawing a blank on this one.

I have an Excel database made up of 24 columns (representing numeric
fields) and approximately 2500 rows. Each record will have a value in
at least one of the 24 fields and can have values in up to all 24
fields. I am to create a 25th field (called "ID") in which an "x" is
placed if a record meets the following criteria:

1.) It must have values in at least 2 of the 24 fields, and
2.) At least 1 of the fields with a value in it is not contiguous with
another field with a value in it.

In other words, to qualify for an "x", at least 2 fields have numbers
and there is a gap separating at least one of those fields.

Here's a simplified version:


Field1 Field2 Field3 Field4 Field5 ID
------------------------------------------
12
------------------------------------------
3 14 x
------------------------------------------
1 5
------------------------------------------
7 8 12 x
------------------------------------------
2 3
------------------------------------------
6 5 4 x
------------------------------------------
8 7 1 12 14
------------------------------------------
7 8 10 11 x
------------------------------------------


Either a macro solution or a formula solution to getting the "x" is
fine, and if "helper" columns are needed, that's fine, too.

Many thanks,
Paul
 
Dick,

Thank you very much for your considerable time and effort. This was a
big help, and I appreciate the work you put in on it for me very much.

Many thanks,
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top