title: Date manipulation periods
body: <p>I have this problem  for work. So I have this dataset as follows:</p>
  
  <pre><code>Client  Date    Transaction Num
  A   7/20/2017   1
  A   7/26/2017   1
  A   7/31/2017   1
  A   8/23/2017   2
  A   8/31/2017   2
  A   9/11/2017   2
  A   9/19/2017   3
  A   9/27/2017   3
  A   10/4/2017   3
  B   6/1/2017    1
  B   6/29/2017   1
  B   7/6/2017    2
  B   8/27/2017   3
  B   9/28/2017   4
  B   10/16/2017  4
  B   11/30/2017  5
  </code></pre>
  
  <p>What I need to do is generate the transaction num based on the date for each client as follows:</p>
  
  <p>For the starting date (for client A, it is 7/20/17), I need to assign a starting transaction Number = 1. Then for every 30 days from this starting date, I need to increment the transaction number by one. So 30 days from 7/20/17 is 8/19/17, so all dates falling within this range get transaction num =1, then if they exceed, the transaction number increments by one for every 30 days from starting date. This pattern goes on, so 30 days from 8/19/17 is 9/18/17, so dates within this range gets transaction num =2, and after 9/18/17, gets transaction num = 3 and so on. </p>
  
  <p>I need to do this for a large excel. Any help would be appreciated. If it easier in python, please let me know as well.</p>
  
  <p>Thanks,
  Sammy</p>