IIf statement with Calculation (1 Viewer)

karl009

Registered User.
Local time
Today, 11:40
Joined
Mar 2, 2010
Messages
55
Hi,

I have the following IIf statement;

MarkupCost1: IIf([Markup]='',([Markup]*[GBPCost]),[PSP])

What am trying to do is if the [Markup] is blank then show the [PSP] value, but if the [Markup] is not blank then do the calculation ([Markup]*[GBPCost]).

The above IIf shows the [PSP] value when there is no data in [Markup] but when I enter data I get #Error in [MarkupCost1].

What am I doing wrong.
Thanks
Karl
 

vbaInet

AWF VIP
Local time
Today, 11:40
Joined
Jan 22, 2010
Messages
26,374
MarkupCost1: IIf([Markup] & ""=''",([Markup]*[GBPCost]),[PSP])
 

DCrake

Remembered
Local time
Today, 11:40
Joined
Jun 8, 2005
Messages
8,632
MarkupCost1: IIf(Trim([Markup] & "") <> "",([Markup]*[GBPCost]),[PSP])

Or

MarkupCost1: IIf(Not IsNull([Markup]),([Markup]*[GBPCost]),[PSP])

Or

MarkupCost1: IIf([Markup] Is Not Null,([Markup]*[GBPCost]),[PSP])

First example deals with fields that are blank but are not null

2nd & 3rd handle Null values only. Field could be empty but not null
 

Users who are viewing this thread

Top Bottom