0

Having trouble pulling a nested if statement. Trying to say if a date is over under another date it is "Moving" or "Not Moving". Should not be a big deal but can not seem to figure out why they all pull "Moving" even though it is not correct.

=IF(VLOOKUP(N2,$O$2:$P$5048,2,FALSE)>=$L$4,"Moving",IF(VLOOKUP(N2,$O$2:$P$5048,2,FALSE) < $L$4,"Not Moving", ))

https://ibb.co/bvGSgk

https://ibb.co/emovZ5

Also my first-time post. I apologize for any incorrect formatting.

1

You do not need the second IF when only two outputs are expected:

=IF(VLOOKUP(N2,O2:$P$5048,2,FALSE)>=$L$4,"Moving","Not Moving")

Simply it is

=IF(Condition, What to do if true, What to do if false)

https://support.office.com/en-us/article/IF-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2


Also are you sure about the O2 being relative? It makes more sense that it should be $O$2

In fact, there is no detriment to using full column references in VLOOKUP:

=IF(VLOOKUP(N2,$O:$P,2,FALSE)>=$L$4,"Moving","Not Moving")
6
  • Every value is now 'Not Moving". >=IF(VLOOKUP(N2,O:Q,3,FALSE)>=$L$4,"Moving","Not Moving") – wmather7 Aug 25 '17 at 14:50
  • Then the issue is with the data and not the formula. Without a snapshot of the data we cannot be of more help. – Scott Craner Aug 25 '17 at 14:51
  • Added images of the data. – wmather7 Aug 25 '17 at 14:56
  • Try just the vlookup, does it return what you expect, if not get that working first. – Scott Craner Aug 25 '17 at 14:58
  • Not sure if this is the issue, but it looks like you are comparing a text (column P) to a number $L$4. either wrap the vlookup with =Value() or convert column P to numbers. Also, I'm not sure the vlookup is really what you want, as you are just comparing values in column p to $L$4. If you are looking for the last entry of that number in column N, then you'll need a different formula. – gns100 Aug 25 '17 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.