Compare data, if, then else if ?

charmallan

New Member
Joined
Nov 14, 2015
Messages
3
Hi. Sorry, new to this. Need to find a way to semi process some data. Perhaps easier to demo with a table.
My data is column A has changing values, ie site names is not a constant, but the rest of the text is. I have about 50 of these statements. Each of these statements can be associated with a specific keyword. What i would like to do, is ensure that column A is in the correct format. (Perhaps this can reference a list with set values to match ?) Then i need the data from column a to do something like, if a ="-Business Area - Type - Air Compressors" and Column B contains "air compressor" or Compressor", then Column C = Air compressor. Can this be done ? I'm trying to read up on these if , then and if else statements, but I cant get anything to work. Please help ?

ABCDE
Site- Area - Type - Air SupplyAir Compressor

Air Compressor
ST - Area - Type - VentsVentVent

Site- Area - Type - xCompressor, airAir Compressor


<tbody>
</tbody>
 

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
10,985
this is not at all clear.
My data is column A has changing values - what does this mean ?
what is in column A the first row infers it is .................
Site- Area - Type - Air Supply
is air supply equivalent to air compressor
and is air compressor equivalent to compressor
and if columns A and B have matching equivalents do you want the approved words to go into column C
 

charmallan

New Member
Joined
Nov 14, 2015
Messages
3
Oh dear, sorry for the confusion, but i think you are on the right track. Essentially, the site name and the Area part of the text in column A will change. The constant part of the text "type-Air Supply-" should be associated with terms such as "Compressor" or "Air Compressor", which would appear in column B. I need column C to be consistent, so if column A matches Column B, regardless whether column B matched Column A through the term "Compressor" or "Air Compressor", then column C would be the equivalent to "Air Compressor". I dont know how to start an if or statement. It seems pretty simple, yet I cant get it to work. Should it not be something easy like,
IF A="type-Air Supply-" And "B=Air Compressor" Then C=Air Compressor.ELSEIF
A="type-Air Supply-" And "B=Compressor" Then C=Air Compressor
IF NO MATCH then Skip and loop through the rest of the data.

I'm making a mess of this right ?
 

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
10,985
we are looking for the "correct" techncal term
let us consider…….air,,,,,,air supply,,,,,,,,air compressor,,,,,,,,,,compressor,,,,,,,,,compressor supply
if all of these terms are equivalent and the preferred wording is AIR COMPRESSOR
then is the table below correct
airairair compressor
airair supplyair compressor
aircompressorair compressor
compressor supplyair supplyair compressor
airbananaINSUFFICIENT INFO

<colgroup><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 

charmallan

New Member
Joined
Nov 14, 2015
Messages
3
yes, that looks right to me. But I've no idea how to compile it into something useful that will actually analyse the data. Have you got an idea for me please ? I dont mind learning, i just don't now where to start.
 

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
10,985
airairair compressorrr
airair supplyair compressorrr
aircompressorair compressorrrthis is mytable
compressor supplyair supplyair compressorrr
airbananaNO MATCH
airair compressorrr
air supplyair compressorrr
bananafruit
compressorair compressorrr
compressor supplyair compressorrr
the formula in C1 is
=IF(VLOOKUP(A1,mytable,2)=VLOOKUP(B1,mytable,2),VLOOKUP(B1,mytable,2),"NO MATCH")
you will need to build up the lookup table
with all the words for all the other things
NOTE WHEN YOU HAVE ADDED THEM, HIGHLIGHT
THE LOOKUP TABLE AND SORT BY LEFT HAND COLUMN ASCENDING

<colgroup><col><col><col><col span="5"><col><col><col></colgroup><tbody>
</tbody>
 

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
10,985
I am happy to talk about it further off line - if you want to PM me your Email address (DO NOT ADVERTISE YOUR eMAIL ON HERE)
 

Forum statistics

Threads
1,082,336
Messages
5,364,701
Members
400,811
Latest member
MSBINinja

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top