Forum Discussion

IanTJames's avatar
IanTJames
Copper Contributor
Aug 05, 2022
Solved

Calculate battery power used

Help please.

I have four columns of data with 50k lines.  Col1 has an equipment identifier (23 units), cols2 & 3 contain datetime codes for equipment login/logout and col4 holds battery level percentages.  The table is sorted by Equipment ID then chronologically top to bottom by login datetime. The figures in col4 descend from between 90% & 100% to “around” 20%, with multiple login/logout events between, at which point a recharge/change event occurs and the next cell (below) will be back at between 90% & 100%.

Need to determine the time period (hrs) and actual percentage used between battery change/charge events.

Can this be achieved with the use of a formula or would a macro be required?

  • IanTJames 

    This was a fascinating project because MAP was bonking out (I7 processor, 32 GB RAM) with this large data set.  I had used MAP to identify the rows where the calculations would run and to help with the subtraction.  MAP/INDEX/ROW seems to have limits.  I did not try this with insider functions.

     

    I went with simpler dynamic arrays.  Ultimately, this data set has to be paired down to perform the calculations.

     

Resources