Help with Nested If, And, & Or Statements or somehow using a table w/ lookup functions ?

Lynn0713

New Member
Joined
Feb 27, 2013
Messages
11
Hello,

I'm by no means an expert in Excel, but I usually can get by. However, I am trying to figure out the best / easiest way to insert the insurance company based off the Date in Column A and the Loss Type in Column V. I would like the result (the insurance company) to go in Column U)

Here is what I have to try and explain my logic on this.

Claim Type - Column VDOL Range - Column AInsurance Company
PD Ins.Before 3/1/2016Ins. Co. A
PDBefore 3/1/2016Ins. Co. C
BIBefore 3/1/2016Ins. Co. A
Cargo Ins.Before 3/1/2015Ins. Co. B
Cargo Ins.After 3/1/2015Ins. Co. E
CargoAnytimeIns. Co. C
VPD Ins.Before 3/1/2015Ins. Co. B
VPD Ins.After 3/1/2015Ins. Co. F
VPDAnytimeIns. Co. C
AccidentAnytimeIns. Co. C
IncidentAnytimeIns. Co. C
PDAfter 3/1/2016Ins. Co. B
BIAfter 3/1/2016Ins. Co. B

<tbody>
</tbody>

IF A2< “3/1/2016” AND V2= “PD Ins.” OR V2= “BI”, Ins. Co. A
IF A2>= “3/1/2016” AND V2= “PD” OR V2= “BI”, Ins. Co. B
IF A2< “3/1/2016” AND V2 = “PD”, Ins. Co. C
IF A2< “3/1/2015” AND V2= “Cargo Ins.”, Ins. Co. D
IF A2>= “3/1/2015” AND V2= “Cargo Ins.”, Ins. Co. E
IF A2< “3/1/2015” AND V2= “VPD Ins.”, Ins. Co. D
IF A2>= “3/1/2015” AND V2= “VPD Ins.”, Ins. Co. F
IF OR V2= “VPD”, “Cargo”, “Accident”, “Incident”, Ins. Co. C




Here is a small portion of an example spreadsheet (I did remove some columns for the example below, so the "insurer" isn't in column U below & loss type isn't in V2 below, but that is the column in the actual spreadsheet):


DOLOfficeCompanyCityStateIns.?Police ReportCargo Claim OpenVPD Claim OpenPD Claim OpenBI Claim OpenTotal # of ClaimsLoss TypeInsurer
12/19/11ETKSETKSJacksonvilleFLYXNNNY2Incident
12/19/11ETKSETKSJacksonvilleFLYXY2BI
12/19/11ETKSETKSJacksonvilleFLYXN2PD Ins.
6/3/14TPFLETCCantonmentFLYYNNNN4Accident
6/3/14TPFLETCCantonmentFLYYN4BI
6/3/14TPFLETCCantonmentFLYYN4BI
6/3/14TPFLETCCantonmentFLYYN4BI
6/3/14TPFLETCCantonmentFLYYN4PD Ins.
9/15/14RDGARPSDecaturGAYYNNNY3Accident
9/15/14RDGARPSDecaturGAYYN3VPD Ins.
9/15/14RDGARPSDecaturGAYYY3BI
9/15/14RDGARPSDecaturGAYYN3PD Ins.
10/8/14SKFLRPSCallahanFLYYNNNY3Accident
10/8/14SKFLRPSCallahanFLYYY3BI
10/8/14SKFLRPSCallahanFLYYY3BI

<tbody>
</tbody>

<tbody>
</tbody>


Thank all of you in advance for your assistance, knowledge, and expertise! I do appreciate it.
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Code:
=IF(condition, true, false)

Code:
=IF(condition, true, IF(condition, true, false))

Code:
=IF(condition, true, IF(condition, true, IF(condition, true, false)))

Code:
=IF(condition, true, IF(condition, true, IF(condition, true, IF(condition, true, false))))

Adding that much into an IF function can, as you can see, get confusing very quickly.

I would probably store some constants in hidden fields and reference those just to make it a little easier to write.

EG: Instead of writing something like:

Code:
IF(A2<“3/1/2016”, true, false)

You can do something like:

Z1 = 3/1/2016
Code:
IF(A2< Z1, true, false)

Good luck.
 
Last edited:
Upvote 0
Agree that nesting IF's to any depth can become problematic to keep track of.

I would suggest putting together a small(?) table that would have the dates and codes, and contain the company, something like this...

A​
B​
C​
D​
1​
3/1/2015​
3/1/2016​
3/1/2017​
2​
PD Insaaffkk
3​
BIbbggll
4​
PDcchhmm
5​
Cargo Insddiinn
6​
VPD Inseejjoo
7​
8​
9​
10​
gg
4/1/2016​
BI
A10=INDEX($B$2:$D$6,MATCH(C10,$A$2:$A$6,0),MATCH(B10,$B$1:$D$1,1))
 
Upvote 0
Thank you so much, this worked perfectly!

I made the table with the dates, loss types, and insurance companies, used your formula, and it did it perfectly! I'm currently working with a small sample data of 231 rows - the project I have to finish has closer to 1500 rows, so this really helped me out!

Thank you again.

Agree that nesting IF's to any depth can become problematic to keep track of.

I would suggest putting together a small(?) table that would have the dates and codes, and contain the company, something like this...

A​
B​
C​
D​
1​
3/1/2015​
3/1/2016​
3/1/2017​
2​
PD Insaaffkk
3​
BIbbggll
4​
PDcchhmm
5​
Cargo Insddiinn
6​
VPD Inseejjoo
7​
8​
9​
10​
gg
4/1/2016​
BI

<tbody>
</tbody>

A10=INDEX($B$2:$D$6,MATCH(C10,$A$2:$A$6,0),MATCH(B10,$B$1:$D$1,1))
 
Upvote 0

Forum statistics

Threads
1,215,421
Messages
6,124,806
Members
449,191
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top