I know this question has been already asked a few times, but every statement that I try I end up with error messages.
I need a simple excel if statement where I can try out 3 possibilities:
I need to check 3 date columns, A1, B1 and C1. If all 3 are fullfilled, I need to subtract either C1 or B1 by A1. If B1 is empty, then I need to subtract C1 by A1. If C1 is empty, then I need to subtract B1 by A1. By all other results I need 0 to be returned.
Can anyone help me with that? I'm using excel 2016.
I tried the following statement: =IF(B2<>"";B2;C2)-A2
But it doesn't really cover all cases.
Same result for sample as accepted 'Excel Version' A except for all 3 are fullfilled case:
Assumes Brazilian date formats.
Whatever the garbled English is supposed to mean (there is an SE site for a Portuguese version of SO) the results of the first two rows are not required to be the same:
The second row of the example is blank for (I assume, since OP has not bothered to clarify cell references) C1, hence:
The first row is however populated in all three cells, hence:
In the first row (and indeed all rows in the sample) B1 and A1 are not the same. So for that row there are two different results, which therefore cannot both be the same as any other (single) result, such as whatever is the result for the second row.
Math Version
Excel Version