Forum Discussion
MITVal23
Nov 14, 2022Copper Contributor
IF function and Structured references need syntax help
I have spent hours trying to figure this formula out, and I am so tired and ready for this to end. I need help trying to set up syntax. To enter a formula using the IF function and structured references that test whether the value in the "tier" field is equal to "platinum," if it is, multiply the value in the "total sales" field by 0.05. Otherwise, enter 0 in the cell.
Please please, pretty please help
- mathetesSilver Contributor
It would help give you a specific formula if you were to show us the actual layout of your data. Absent that, only a general idea of the IF formula can be supplied.
So, assuming "tier" is in cell C2 and "total sales" is D2, then this formula could go in E2 (or wherever you want it to be).
=IF(C2="platinum",D2*.05,0)
- PeterBartholomew1Silver Contributor
Where did the structured references go? Why not
= IF([@tier]="platinum", [@sales]*5%, 0)
But then, I am the only person on this forum that refers to the A1 notation as an abomination that has no place in any computational environment!
- mathetesSilver Contributor
Come to think of it, we also advocate against hard-coding values in a formula. So why wouldn't
= IF([@tier]="platinum", [@sales]*5%, 0)
become something like
= IF([@tier]="platinum", [@sales]*PctMult, 0)
referring to a named range off to the side?