+ Reply to Thread
Results 1 to 15 of 15

False to True Transition Calculation

  1. #1
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    False to True Transition Calculation

    Good Day All,
    I am new to this Forum and this is my First ever post.
    I am trying to find out if I could calculate the time differences between 0 to 1 Transitions in a Column.Sample of the File is attached.
    A file such as the one in the attachment is created at midnight everyday.This happens on one of the computers for Data Acquisition on a machine.
    I have been asked to calculate the time intervals every time a transition from a 0 to a 1 (Blue Arrows) happens. This file is updated every three seconds (red arrow) as shown in the attachment.The times calculated can be stored in Column D.(where the Blue Arrows are located in the file).
    Just before midnight, I would like to save this file (new file name) with the date, the rows with Transitions only and the calculated Time Intervals.This file has to be emailed to a group of users in our factory.
    Right after midnight, a new file is created and overwrites the original file.
    Is this possible to do using Excel VBA?
    Any help or suggestions will be appreciated.
    Thank you all in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    changeofstate.xlsx

    Just to get you going this will calculate the times between the change of state.

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: False to True Transition Calculation

    Please Login or Register  to view this content.
    copy column B format in column E
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Good Day Crooza and patel45,
    Thank you very much for your feedback.Both solutions worked.
    I would also like to find out how can the following be done:-
    a)If I wanted to find out when the each change of state occurred with reference to mid-night (from the time the file was created) in a separate column.
    b)How many times the change of state occurred during the whole day.
    c)Save this file just prior to midnight with a unique file name with date.
    d)Email the saved file to a number of people.
    Thanks in advance.

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    for a) isn't this what you've got in column B
    for b) put this in F1 in my example above
    Please Login or Register  to view this content.
    for c) I suspect there's a batch file routine you can run to do this but I've never done this. Some fo the smarter guys and gals can do this
    for d) If you do a search on here you'll find plenty of examples of vba code to send files through outlook.

  6. #6
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Hello Crooza,
    Thank you very much for all the help.
    Take care and have a great day!

  7. #7
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Hello All,
    How can I calculate the average time of all 0 to 1 transitions?
    Thanks in advance.

  8. #8
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    Have you tried using the average formula? Look at where I put the countif formula and use the same range as this will average the transition times

    It should look like =average(range)

  9. #9
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Crooza,
    It works! Thanks a lot once again.

  10. #10
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    I'm glad it worked. In regard to your automatic email issue the following code may assist although I'm not sure how you automate the run time.

    It's a bit like a mailmerge for email. You could simplify it by hardcoding the email addresses and other fields in but this one also gives you the flexibility of sending multiple emails to people and slightly adjusting the email like a mail merge so it's a little more personal.

    As well as the code I've attached the workbook with the code in so you can see how I do this.

    Please Login or Register  to view this content.
    mail merge excel macro v1.xlsm

  11. #11
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Crooza,
    Thanks for your feedback. I will try it as soon as I have a few minutes.
    I was looking at the file that I have to work on.I have to calculate all the Zero to One Transition times.Once that is done, I have to create a chart for the Time mentioned in Column "B" (X-Axis) and Zero to One Transition Times (Y-Axis). Once the chart is done, I have to calculate the Zero to One Transitions that are a)equal to 10 b)Greater than 10. These values (a) and (b) can be stored in two individual cells.
    Once the above is done, I have to email the spreadsheet to numerous people.
    The file is attached.
    Thanks in advance and have a great day!
    Attached Files Attached Files

  12. #12
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    Sorry for delay,

    I've been on other things.

    If you put this in d3 and copy down

    Please Login or Register  to view this content.

    and this in E3 and copy down

    Please Login or Register  to view this content.
    this
    Please Login or Register  to view this content.
    , this
    Please Login or Register  to view this content.
    and this
    Please Login or Register  to view this content.
    in three separate cells you'll get the average, less than 10 and greater than 10 counts.

    I don't know what you want to graph though. If you have a time series along the X axis representing the whole day do you then want to show columns when ther transition occurs and the column hieght is the time to transition?

  13. #13
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Crooza,
    Thanks for the update.
    I would like to graph the "Actual Time" when the 0 to 1 Transition took place on x-axis versus "Time Between Transitions" on the y-axis.
    Have a great day!

  14. #14
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: False to True Transition Calculation

    0 to 1 transition short version.xlsx

    Sparky,

    Sorry for the delay.

    The attached will work but I had to cut it down in size to get it to meet the server limits for file size.This is a real pain by the way.

    You can add any day's data in to columns A- C and the spreadsheet will do teh rest in regards to your average, <10 and >10 minutes calcs and the graphing. It basically grabs justthe data that is relevant for graphing from teh big stream of data in columns d and E then graphs that. The graph will look a bit weird until you put your data back in and then extend the formulas in columns D and E. Essentially I cut the bottom few thousand rows off to meet the file size.

    If this doesn't work let me know and if you can give me an email address I can email it to you direct. The file in its full form is only just over 1 MB

  15. #15
    Registered User
    Join Date
    08-02-2014
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    15

    Re: False to True Transition Calculation

    Good Crooza,
    Thanks for the update. I will check it out and let you know how it pans out.
    Have a great weekend!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What is best to use for helper cells 0 or 1, typed true or false or =true =false
    By Gingermuppet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2014, 10:41 PM
  2. [SOLVED] in this TRUE OR FALSE function, i want desired name instead of display true or false
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2013, 06:44 PM
  3. Variance calculation to return true/false
    By Ivor in forum Excel General
    Replies: 9
    Last Post: 07-05-2010, 07:46 AM
  4. Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  5. [SOLVED] Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1