Help

Re: Issues With A Nested IF Statement

Solved
Jump to Solution
47 0
cancel
Showing results for 
Search instead for 
Did you mean: 
SparKey
1 - Visitor
1 - Visitor

Hi, 

I am hoping that someone might be able to help with a nested IF Statement I have a field that determines the size of an advert. I want another field to list the price for the advert based on the selection in the first column.

This is the If Statement I created, but something is not quite right because it always shows the value £0.00

IF(
  {Advert Size}='Full Size','£100.00','£0.00',
  IF({Advert ID}='Half Size','£50.00',
  IF({Advert Size}='Quater Size','£25.00','£0.00'
  )
  )
)
 
Thanks in advance for your help. 
 
S
1 Solution

Accepted Solutions
Alexey_Gusev
13 - Mars
13 - Mars

Hi,

In your example, error is '£0.00',  in first line.
In common, it should be IF ( condition ,  _when condition is true_  , _when condition is false_ ) , but then you should substitute last argument and start next line right after  _when condition is true_  ,

Anyway, your case has better and easier readable solution - use SWITCH

SWITCH({Advert Size},
'Full Size','£100.00',
'Half Size','£50.00',
'Quater Size','£25.00',
'£0.00')

Alexey_Gusev_0-1734106034236.png

 




See Solution in Thread

2 Replies 2
Alexey_Gusev
13 - Mars
13 - Mars

Hi,

In your example, error is '£0.00',  in first line.
In common, it should be IF ( condition ,  _when condition is true_  , _when condition is false_ ) , but then you should substitute last argument and start next line right after  _when condition is true_  ,

Anyway, your case has better and easier readable solution - use SWITCH

SWITCH({Advert Size},
'Full Size','£100.00',
'Half Size','£50.00',
'Quater Size','£25.00',
'£0.00')

Alexey_Gusev_0-1734106034236.png

 




Hi Alexey_Gusev,

Ooooo I like this. Thanks. I had tried without the £0.00 on the first line but it still didn't work. Now I guess that's likley because the order of the formula is back to front.

However, your {SWITCH} Solution is far more elegant. Thanks for the help. 

S