Apr 16 2021 07:08 AM
I am trying to create a function to calculate the number of each cake flavor needed.
This is what I was trying to input into P2 but got a NAME error: =IF(J2=”Vanilla”,L2,"")
I was also planning to do this with each flavor in Q2, R2, S2, and T2.
Note, the numbers showing now are what I manually entered but wanted to show you what the end goal was. Thank you!
PC/Win 10 Excel 365
Apr 16 2021 07:43 AM
In P2:
=IF($J2=P$1,$L2,"")
If you use comma as decimal separator, it should be
=IF($J2=P$1$L2;"")
Fill down, then to the right (or vice versa).
Apr 16 2021 07:44 AM
SolutionApr 16 2021 06:21 PM - edited Apr 16 2021 06:22 PM
Thanks, I tried yours too and the first one worked but the second formula filled the cell with the formula, not the number. I tried formatting the cell as a number and checking the box with the comma but didn't help.
Apr 17 2021 02:18 AM
As a comment, based on screenshot only, especially if it doesn't show what is in formula bar, quit often it's hard to understand what is the actual reason of the error. On this site we may only make some guesses. Hans indicated two possible reasons - wrong quotes and in your locale you shall use semicolons instead of commas. One of them works.
Bottom line - it's always better to provide small sample file which illustrates an issue. Answers will be more exact and received more fast.
Apr 16 2021 07:44 AM
SolutionYou are using the wrong quote signs:
=IF(J2="Vanilla",L2,"")