IIf Statement with or

flip_33_

New Member
Joined
Mar 5, 2003
Messages
42
In a query i have the following code which gives any record with an employee ID's starting with a P ( which are accounts payable ) the paygroup ( PAYGRP ) AP so we can seperate them...

PAYGRP: IIf(Left([EMP_ID],1)="P","AP",[PAY_GRP])

How do i edit the current code so if the employee Id starts with R, it gives them the PAYGRP AR, as well as still keeping the current operation it is performing...
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I think this is it:

PAY_GRP: IIf(Left([EMP_ID],1)="P","AP",IIf(Left([EMP_ID],1)="R","AR",[PAY_GRP]))

Hope this helps!!!
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,341
Members
451,638
Latest member
MyFlower

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