You need to sign in to do that
Don't have an account?
George Adams
Creating basic formula field (Incorrect number of parameters for function 'IF()')
Hello,
I have what I think is a simple question. I am trying to do the following:
There's a good chance I'm making a simple mistake here, just can't seem to find it.
Thanks!
I have what I think is a simple question. I am trying to do the following:
- Have the formula look at MK_Days_When_Postmarked__c
- If it is blank, run throught the 4 calculations regarding trial date messages
- If it is not blank, run TEXT(MK_Days_When_Postmarked__c) (ie. show the number in that field)
IF( ISNULL(MK_Days_When_Postmarked__c), IF( MK_Days_Into_Trial__c = 0 , "Not Yet Shipped" , IF( MK_Days_Into_Trial__c < 46 , "Day " + TEXT(MK_Days_Into_Trial__c) , IF( MK_Days_Into_Trial__c < 51 , "Manually Calculate (~" + TEXT(MK_Days_Into_Trial__c) +" Days)" , IF( MK_Days_Into_Trial__c > 50 ,"Out of Trial (" + TEXT(MK_Days_Into_Trial__c) + " Days)", TEXT(MK_Days_When_Postmarked__c) ) ) ) ) )
There's a good chance I'm making a simple mistake here, just can't seem to find it.
Thanks!
All Answers
seems like your outermost If statement has only 2 parameters. If statement should be IF(condition, ifTrue, ifFalse)
My understanding is that my formula is setup as IF( ISNULL(MK_Days_When_Postmarked__c), [all the statements about trial date], [just show what's in MK_Days_When_Postmarked__c]).
Is that not the way I've written it?
MK_Days_When_Postmarked__c
), [all statements])
TEXT(MK_Days_When_Postmarked__c) belongs to the last inner IF statement. not to the outermost statement.
Expected 3, received 4.
it hsoudl be before the last ')'
Can you reverse the ifTrue and ifFalse conditions on the outermost IF?
I can't seem to get it working. As in, if ISNULL(MK_Days_When_Postmarked__c) is true, then just run all the IFs, but if not, just run TEXT(MK_Days_When_Postmarked__c).
I reversed the order by accident.
you can do it by replacing "text" with TEXT(MK_Days_When_Postmarked__c). But what did you want ot do in the innermsot IF statemebnt. whats suppsoed to happen if MK_Days_Into_Trial__c<=50?
If (MK_Days_When_Postmarked__c is null) then
if(MK_Days_Into_Trial__c == 0) you return Note Yet SHipped
if(MK_Days_Into_Trial__c <46 you return "Day " + TEXT(MK_Days_Into_Trial__c)
if( MK_Days_Into_Trial__c >=51 you return "Out of Trial (" + TEXT(MK_Days_Into_Trial__c) + " Days)"
but if its >=46 AND <51 you return "Manually Calculate (~" + TEXT(MK_Days_Into_Trial__c) +" Days)"
AND if MK_Days_When_Postmarked__c is not null then return MK_Days_When_Postmarked__c
So is this correct?
If I change MK_Days_When_Postmarked__c to any number, however, it returns that number. So it does look like it's copying MK_Days_When_Postmarked__c BUT when that field is blank, it seems to think it's not blank.