excel - Test for change in month from list of dates -


i want code in vba identify each time there's change in month, example january february.

in below example can see want take input column b, , output column c. output should be:

  • test when month change occurs.
  • train when month same before.

example data:

a       b              c 1       29/12/2006     train     2       01/01/2007     test     3       02/01/2007     train     4       03/01/2007     train     5       04/01/2007     train     6       05/01/2007     train ..    100     01/07/2007     test 

here's way. a1-day(a1) return last day of preceding month. so:

b2:  =if((a1-day(a1))=(a2-day(a2)),"train","test") 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -