0

I am nesting an IF statement inside a DATEDIF to determine employee tenure. I am trying to write the formula in such a way that pulls the termination date if the cell is not blank, but uses today's date if the cell is blank.

Here is the formula I wrote but it is coming back with a #NAME? error.

=DATEDIF([@[Hire Date]],IFS([@[Exit Date]]<>””,[@[Exit Date]],[@[Exit Date]]="",TODAY()),"M")

1 Answers1

0

You seem to have some sort of strange quotes ”” in there.

Try this.

=DATEDIF([@[Hire Date]],IF([@[Exit Date]]<>"",[@[Exit Date]],TODAY()),"M")

Note, I don't think you need the nested IF - the above formula will give the same answer as your formula, once the strange quotes are replaced of course.

norie
  • 9,609
  • 2
  • 11
  • 18
  • So I tried the formula you recommended and I’m still getting a #Name? Error. The <>”” means if a cell isn’t blank and =“” means the cell is blank based on what I found online. – Mary La Point Nov 27 '22 at 16:22