IIf, with AND

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
774
Office Version
  1. 365
Platform
  1. Windows
Good afternoon

I am having an issue creating an "Iif" statement in my access database via a calculated cell based on data in a table I have created.
If I was doing this in excel it would be fairly easy, but I am a bit rusty with Access so I could do with pointing in the right direction.

Apologies if this is a simple question, but I am a bit lost at the moment and not sure if I am writing the formula correct with missing a parentheses.

Code:
IIf(Len(Trim([TermD]))>0) and (Len(Trim([FTE]))>0),"Leaving the Business",
IIf(Len(Trim([TermD]))>0) and (Len(Trim([FTE]))=0),"Left The Business",
[Employment]))

thanks in advance
Gavin
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this:
Rich (BB code):
IIf((Len(Trim([TermD]))>0) and (Len(Trim([FTE]))>0),"Leaving the Business",
IIf((Len(Trim([TermD]))>0) and (Len(Trim([FTE]))=0),"Left The Business",
[Employment]))
 
Upvote 0
Solution
Try this:
Rich (BB code):
IIf((Len(Trim([TermD]))>0) and (Len(Trim([FTE]))>0),"Leaving the Business",
IIf((Len(Trim([TermD]))>0) and (Len(Trim([FTE]))=0),"Left The Business",
[Employment]))
thanks for this @Joe4,
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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