# Comparing Textual Data producing numerical information

#### Rameses

##### Board Regular
Hi all

OK I am tracking Students BTEC grades (a UK course) and am going round and round in circles

The Data Range is the same in both columns A&B. This is arrayed order below

Dist*
Dist
Merit
Pass
Fail

Column A is students Targeted Grade and column B is Students current Progress
I want to compare both these columns and in column C want to add in a value to express the difference between their targeted and current grades (therefore showing how much the students are passing or failing their BTEC course)

Some examples are as follows

If A1 = Dist
and B1 = Merit
Then C1 should show -1

A1=Merit
B2 = Fail
C1 should show -2

A1 = Pass
B1 = Dist
C1 should show 2

C range would therefore be from 4 to -4

After I have done this I then want to add conditional formatting to column c but I can do this ok

many thanks

Rameses

#### wigi

##### Well-known Member
Hi

In C1:
=MATCH(A1,\$S\$1:\$S\$5,0)-MATCH(B1,\$S\$1:\$S\$5,0)

S1:S5 has the list of 5 possibilities.

#### Rameses

##### Board Regular
You are fantastic

Thankyou so much for that

a) I wonder is there anyway I can put the range into the formula rather than creating an extra column?

Also... I know this is a long shot but...

b) If there is only 1 piece of data entered into either A1 or B1 can it record an "N" into C1

c) And if both A1 and B1 are blank could it record nothing into the cell (But still have the formula applying)

many thanks

Rameses

#### wigi

##### Well-known Member
a) can be done, but a very bad idea. Maintenance should be as easy as possible, rather than changing formulas.

b) + c)

=IF(A1&B1="","",IF(OR(A1="",B1=""),"N",MATCH(A1,\$S\$1:\$S\$5,0)-MATCH(B1,\$S\$1:\$S\$5,0)))

#### Rameses

##### Board Regular
Hi there

I am so grateful

I have decided to get rid of some of my older formlas (which work) when tracking other types of grades as those you have provided are so much simplar, shorter and easier to understand and use..!!!!

For a) the data range would never change so would not need any maintainence hence I wanted to include it in the formula...???

But what you have provided wow....hours i have puzzled over this ... it shows theres always an answer for anything!

many thanks

Rameses

1,081,943
Messages
5,362,268
Members
400,674
Latest member
Thumper007

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...