IF with multiple conditions

samuelmaiia

New Member
Joined
Jul 21, 2019
Messages
1
Hi there,

Maybe someone can help me (is there any video/page I can watch?) as I am struggling to accomplish the following:


I have a huge list with post codes:
DN9 2BT
IP28 8PQ
DT6 4NG
F94 TP9N
LL20 8DD
RH1 2NB
YO22 5NH
TA8 2NZ
B48 7SQ
LL58 8YL


In the second column I want to insert a if statement (or other) that meets the following criteria,

If starts with,



johnpedroalex
CALLSY
LACHTF
BDCWWV
PRWNDY
BBWAWR
BLSKWS
OLIMDE
HXNG
HDLN
FYLE
NN
Any ideas?


Thank you
CV

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,302
Office Version
365
Platform
Windows
Re-posted
 
Last edited by a moderator:

Palacemad

New Member
Joined
May 19, 2019
Messages
40
Hi - I might be able to help!

Can I clarify exactly what you are trying to do, you have your long list of postcodes, do you want them to be placed under the headings of the names?
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,302
Office Version
365
Platform
Windows
Let's try post#2 again!

Assuming that you can ALWAYS identify postcode to name with 2 leftmost characters

Maintain ONE list

Excel 2016 (Windows) 32 bit
A
B
1
2 first
characters
of PostCode
Name
2
CAjohn
3
LAjohn
4
BDjohn
5
PRjohn
6
BBjohn
7
BLjohn
8
OLjohn
9
HXjohn
10
HDjohn
11
FYjohn
12
LLpedro
13
CHpedro
14
CWpedro
15
WNpedro
16
WApedro
17
SKpedro
18
IMpedro
19
SYalex
20
TFalex
21
WValex
22
DYalex
23
WRalex
24
WSalex
25
DEalex
26
NGalex
27
LNalex
28
LEalex
29
NNalex
30
CValex
31
Sheet: Sheet2

And use VLOOKUP

Excel 2016 (Windows) 32 bit
A
B
C
1
PostCodesName Formula in B2 copied down
2
DN9 2BT =IFERROR(VLOOKUP(LEFT(A2,2),Sheet2!A:B,2,0),"")
3
IP28 8PQ
4
DT6 4NG
5
F94 TP9N
6
LL20 8DDpedro
7
RH1 2NB
8
YO22 5NH
9
TA8 2NZ
10
B48 7SQ
11
LL58 8YLpedro
Sheet: Sheet1
 

Watch MrExcel Video

Forum statistics

Threads
1,101,904
Messages
5,483,635
Members
407,400
Latest member
Rakeforms

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top