Access Formula Question

bwlytkr

Board Regular
Joined
Jun 8, 2012
Messages
185
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I created the formula below to return a YES when the ticket is date is > 9/30/2024 and the LU Company is YES G and Job Type name is a Transfer. However, I need to add something to this. I need to exclude any tickets in PXFR NTG column name TicketType and a TRANSFER in this column. Is there a way to add this function to the formula below? I never tried to exclude something from a column before in a formula. Thanks, John

PSC Ticket: IIf([LU Company]="YES G",IIf([PXFR NTG]![JobTypeName]="Transfer",IIf([PXFR NTG]![NextToGoStartDate]>=#09/30/2024#,"YES","High Priority")
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Because I am not sure how to write the formula to exclude the word transfer"TRANSFER" in the Ticket Type column. Any help writing a formula to exclude something in a column would be greatly appreciated. Thx
 
Upvote 0
I figured out how to exclude a text in a column however, now I can't seem to get the query to recognize the last part of this formula, IIf([LU Company]="YES NCSC",IIf([PXFR NTG]![NextToGoStartDate]>=#12/23/23#,"YES"). I have tried comma, and, or, and ) after the "YES" and the expressions prior to this work fine. I just don't get any results from this expression. Below is the complete formula. Any help would be appreciated.

PSC Ticket: IIf([LU Company]="YES G",IIf([PXFR NTG]![JobTypeName]="TRANSFER",IIf([PXFR NTG]![TicketTypeName]<>"Make Ready",IIf([PXFR NTG]![NextToGoStartDate]>=#01/01/2024#,"YES",
IIf([LU Company]="YES NCSC",IIf([PXFR NTG]![NextToGoStartDate]>=#12/23/23#,"YES"))))))
 
Upvote 0
That is getting too complicated to maintain as you can see. It might get worked out, then at some point you'll need to add or modify criteria and will be back to zero. You don't say where you are using that, so maybe it's a form or report field but could be a query.

Why not call a vba function from your query (or control), then you can return just about anything you want from that? Or maybe create a query that returns the result you need and use that as a query field with appropriate criteria on it ( Is Not Null )?
 
Upvote 0
I was gong to suggest your own function next as well.
 
Upvote 0
Sorry, I missed the part where it was stated that this is being done in a query.
 
Upvote 0
thanks for all the info. I have no clue about vba is why I have not used it.
 
Upvote 0
No time like the present to start learning vba. Some people google for code samples, some use AI. Some get code from forums if they can provide enough supporting information.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
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