'Recode variable in Excel based on other variables
Is there a way to recode a variable using the conditions met by 2 other variables in Excel? Here I have a random table of years and months. I would like to create a new column called "Water year" that starts 4 months after the calendar year starts and has a name of the year it ends in (as of now [5/17/2022] we are in the start of the 2023 "Water year", which starts in May and ends in April 2023). I would like to recode my new column in this way.
So, if a calendar year ("YEAR" column) is associated with a MONTH between May to December (5-12), I'd like the recoded column "Water year" to be that year + 1. If a year is associated with a month between January to April (1:4) the Water year is the same as the calendar year (YEAR). Is there an "IF" statement that can be built to do this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

