Forum Discussion
help with formula
- May 07, 2022
I forgot 2 closing parentheses - sorry about that. The first formula should be
=IF(A2="4x6",20,IF(A2="5x7",16,IF(A2="9x4",15,"")))
But you have set up date validation for D2 that only allows the values 1, 2, ..., 10. So 20, 16 and 15 will be rejected.
I'd remove the data validation from D2. If you use a formula, data validation is not needed.
Or use a lookup table. The first column can be the source for the data validation drop-down.
In the screenshot below, the table is named Sizes.
The formula in B2 (on your worksheet it would be D2) is
=IFERROR(VLOOKUP(A2,Sizes,2,FALSE),"")
If you have Microsoft 365 or Office 2021, you can also use
=XLOOKUP(A2,Sizes[Size],Sizes[Cards per Sheet],"")
- JohnShaw19May 07, 2022Copper Contributor
Thanks for that info. So, in the first example I always get an error that says there was a typo in the formula, and it tries to correct it. But then I get an error that says, "The value doesn't match the data validation restrictions, defined by this cell."
In Column A2 I have a data validation criterion of, "list" and in the Source I have 4x6, 5x7, and 9x4. That creates the drop-down values in column A2. This is how the "form" looks:
- HansVogelaarMay 07, 2022MVP
Could you attach a sample workbook (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Thanks in advance.
- JohnShaw19May 07, 2022Copper Contributorsure! There's no sensitive data. Just working out the basic spreadsheet.
https://1drv.ms/x/s!Ag5CIttUj0lyiolPe-WH_GyAh0ZDcg?e=76Ftg0