A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Got the date formats fixed! Thanks for the help! :-)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi....
I'm trying to write what I thought was a simple excel macro, but it seems to be failing. Here is what I am trying to do.... I've tried nested macros etc., but I'm missing something....
Cell A1 = Yes or No;
Cell B1 = a value of 18 or 20;
Cell C1 contains a formatted date value DD-MM-YYYY (representing the date for 18 years);
Cell D1 contains the formatted date value DD-MM-YYY (representing the date for 20 years).
Cell E1 is where I want the formula and results to display
What I am trying to do is basically create a formula for cell E1 that says:
"If A1 = "Yes"; and B1 =18, then display the date from C1. But if Cell A1="Yes" and B1 = 20, then instead display the date from D1", and if the value is neither 18 or 20, then display blank (or leave blank)
Here's one of several I've tried and it gives me errors:
=IF(OR(A1="Yes",IF(B1=20,C1,""),IF(A1="Yes",IF(B1=18,C2,""))))
Tried this too...
=IF(OR(AND(A1="Yes",B1=18,C1,AND(A1="Yes",B1=20,D1,""))))
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Got the date formats fixed! Thanks for the help! :-)
The logic part works perfectly – thanks….. but now the dates are giving me 1900 and 1901 instead of 2030! LOL