title: Google Apps Script : Adding/Subtracting Time - Minutes to a particular column in googles sheet using some conditions
body: <p>I want to be able to add or subtract Time - Minutes to a particular column with some conditions using google app scripts.</p>
  <p>For example: for the Image Below.</p>
  <p>Column A is the Original Time.</p>
  <p>If Column E cell is &quot;Kogi House&quot; and any of Column D cell is &quot;Depart To&quot; then 30 minutes will be added to the original time (column A) which will result to the time in Column C - Duration</p>
  <p>and if any of Column E cell is &quot;Kogi House&quot; and any of Column D cell is &quot;Arrive From&quot; then 30 minutes will be subtracted from original time (column A) which will result to the time in Column C - Duration</p>
  <p>Also, If any of Column E cell is &quot;Apa Estate&quot; and any of Column D cell is &quot;Depart To&quot; then 45 minutes will be added to the original time (column A) which will result to the time in Column C - Duration</p>
  <p>and if any of Column E cell is &quot;Apa Estate&quot; and any of Column D cell is &quot;Arrive From&quot; then 45 minutes will be subtracted from original time (column A) which will result to the time in Column C - Duration</p>
  <p>If any of Column E cell is &quot;Ondo&quot; and any of Column D cell is &quot;Depart To&quot; then 60 minutes will be added to the original time (column A) which will result to the time in Column C - Duration</p>
  <p>and if any of Column E cell is &quot;Ondo&quot; and any of Column D cell is &quot;Arrive From&quot; then 60 minutes will be subtracted from original time (column A) which will result to the time in Column C - Duration.</p>
  <p>This is the Google sheet link <a href="https://docs.google.com/spreadsheets/d/1SKCORyDNwtaQcIetcZy9ogSEG-DmiFx4RFU2izSUqFY" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1SKCORyDNwtaQcIetcZy9ogSEG-DmiFx4RFU2izSUqFY</a></p>
  <p><a href="https://i.stack.imgur.com/yqmuS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yqmuS.png" alt="enter image description here" /></a></p>
  <p>which script can I use to achieve this?</p>