As a new member of the forum, you need to do a couple of things.
SEARCH - use the magnifier icon in the top right corner and see if anyone else has already asked/answered the question
READ - the “How to use this site” section - especially the posting of Code with Code Tags
READ - RT(F)M - Read the (F) Manual - especially the “if-else” statement in this case
TRY - Try out what you think is a “simpler” version, and then make it more complex until you match the complexity you need in order to understand your situation
SHOW - Show us what you have done and what you think and why, and hopefully we can help explain what is really going on.
Since you have 4 minutes of reading on the site since registering, it does not look like you have done any of this. In addition you need to spell out exactly what you need. If you don’t understand any of it, then you need to do more work. If you have an issue with the nested if, is it what the code in the nested if does, or is it how nesting works.
As you can see lots of issues that we could discuss, but we need to have you SHOW us where your issue is.
HTH (Hope That Helps)
Moderator comment: That is perfect answer to that question