• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Hospital stay and discharge dates|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Hospital stay and discharge dates|Power Pivot|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower PivotHospital stay and discharge dates
sp_PrintTopic sp_TopicIcon
Hospital stay and discharge dates
Avatar
Charles Wiesner

New Member
Members

Pivot Tables Quick Start

Excel Tables

Dashboards

Power Query

Power Pivot
Level 0
Forum Posts: 2
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
1
September 2, 2021 - 11:17 pm
sp_Permalink sp_Print

Hello Everyone,

My data set has a list of dates on which specific diet orders stopped and started.  Presumably, if there are gaps in the dates (if the dates are not contiguous), those gaps represent times when the patient was not in the hospital.  Is there a way to group these dates by hospitalization?  I have a column for the diet order and a column for the start and stop dates for that diet order.  Capture-Diet-Order-vs-dates.PNGImage Enlarger

Could I use the firstdate and lastdate in Power Pivot to help me accomplish this?

sp_PlupAttachments Attachments
  • sp_PlupImage Capture-Diet-Order-vs-dates.PNG (201 KB)
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4620
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
2
September 3, 2021 - 1:28 pm
sp_Permalink sp_Print

Hi Charles,

I'd use Power Query to split the date and time components into separate columns, just in case there is a minute or two difference from one date-time to the next. Then you can use this technique to reference the next row in Power Query (use option 2) to see if the dates are the same from one row to the next. 

See example file attached. Note: you didn't give an example of your desired result, so I have only taken this so far. In future, please share a sample Excel file to save us having to manually recreate your data.

Mynda

Avatar
Charles Wiesner

New Member
Members

Pivot Tables Quick Start

Excel Tables

Dashboards

Power Query

Power Pivot
Level 0
Forum Posts: 2
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
3
September 3, 2021 - 9:20 pm
sp_Permalink sp_Print

Thank you Mynda.  From reading your "Read first" post, I see that I should have attached my data set.  Sorry I did not read that before I posted.  Lesson learned.

Thanks again,

Jeff

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mynda Treacy, Saliha Mohamed
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 186
Newest Members:
Kate Dyka
Kwaje Alfred Mogga
thong nguyen
Appiagyei Kofi Frimpong
Hilary Burchfield
Richie Wright
Adel Kock
Barbara Murray
Doug Milne
Siobhan Stringer
Forum Stats:
Groups: 3
Forums: 24
Topics: 6546
Posts: 28658

 

Member Stats:
Guest Posters: 49
Members: 32832
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.