User Profile
Lorenzo
Silver Contributor
Joined 9 years ago
User Widgets
Recent Discussions
Re: PLEASE HELP ME!!! Problem With Excel Formatting Not Working?
EDIT Duplicate of PLEASE HELP ME. Excel Time Formatting Not Working? | Microsoft Community Hub where existing replies say +/- the same thing Why do some of the numbers like 28:44 transform into a complete different number when I enter them? Not sure how many times this question has been answered on this forum and others (all have a Search button/icon)... Please carefully review the pink and green tables and you'll understand the Why: Has shown in the blue table, if you apply Custom. Format [h]:mm you will get the desired display of i.e. 28:44 when entering 28:44 (instead of 00:28:44) - However, the actual duration will remain 1day, 4hrs and 44mins15Views0likes0CommentsRe: Top n vs. Others in Excel
Hi As I understand & assuming it's doable this would require Power Pivot - not sure & not my expertise 😒 However, I believe you should clarify how you expect to distinguish the TOP 5 (in green below) when several years display, ex.: - Based on the Average by column/Brand or something else? - What if the 6th, 7th... value equals the 5th?20Views0likes0CommentsRe: How to create a multi-tiered percentage-based bar chart?
Hi A 365 dynamic option. With your data formatted as table named Table1 in the below formula: =LET( data, Table1, colsCount, COLUMNS( data ), fieldsCount, colsCount -1, names, TOCOL( IF( SEQUENCE(, fieldsCount/2), CHOOSECOLS(data, 1) ) ), values, WRAPROWS( TOCOL( CHOOSECOLS(data, SEQUENCE(fieldsCount,,2) ) ), 2 ), VSTACK( {"Employee name", "value 1", "value 2"}, HSTACK( names, values ) ) ) (this site doesn't allow me to attach the corresponding file 😔)8Views1like0CommentsRe: Top n vs. Others in Excel
Hi 2 days with no reply probably means nobody's ready to re-create existing data (takes time), running the risk it doesn't reflect yours ==> Suggest you share your workbook (anonymized) with OneDrive, Google Drive or the like Also, please mention the version of Excel you run and on which platform (Windows, Mac, Web...) Hope this all makes sense47Views2likes0CommentsRe: Calculate overlapping hours
Another Power Query alternative adapted from a solution (https://stackoverflow.com/questions/79487991/combine-rows-if-the-dates-exist-in-another-row) developed by Ron Rosenfeld - Credit OliverScheurich for finding that case // TableData let Source = Excel.CurrentWorkbook(){[Name="TableData"]}[Content], FilteredTime = Table.SelectRows( Source, each [End Time] > [Start Time] ), ChangedTypes = Table.TransformColumnTypes( FilteredTime, { {"Volunteer Name", type text}, {"Date", type date}, {"Start Time", type time}, {"End Time", type time}, {"Supervisor", type text} } ) in ChangedTypes // RonRosenfeld_NoOverlap // Adapted from solutiuon posted by Ron Rosenfeld: // https://stackoverflow.com/questions/79487991/combine-rows-if-the-dates-exist-in-another-row let Source = TableData, SelectedColumns = Table.SelectColumns( Source, {"Supervisor", "Date", "Start Time", "End Time"} ), // Group by Date & Supervisor NoOverlapBySupervisorDate = Table.Group( SelectedColumns, {"Date", "Supervisor"}, // Add [Shifted End Time] column to each sorted subgroup {"Shifted", (t) => let RemovedColumns = Table.RemoveColumns( t, {"Date", "Supervisor"} ), SortedStartTime = Table.Sort( RemovedColumns, {"Start Time",Order.Ascending} ), ShiftedEndTime = Table.FromColumns( Table.ToColumns( SortedStartTime ) & { {null} & List.RemoveLastN( Table.Column( SortedStartTime,"End Time"), 1 ) }, type table [Start Time = time, End Time = time, Shifted End Time = nullable time] ), // Overlap exists if [Start time] is less than the [Shifted End time] TimeOverlaps = Table.AddColumn( ShiftedEndTime, "Overlap", each [Start Time] < [Shifted End Time], type logical ), // First row in [Overlap] column will be null so we fill up from the second row to see if they overlap FilledUpOverlap = Table.FillUp( TimeOverlaps, {"Overlap"} ) in // Group each subtable by the logical overlap Table.Group( FilledUpOverlap, "Overlap", { {"Start Time", each List.Min( [Start Time] ), type time}, {"End Time", each List.Max( [End Time] ), type time} }, GroupKind.Local, (x, y) => Number.From( y <> true ) ), type table [Overlap = logical, Start Time = time, End Time = time] } ), ExpandedTimeColumns = Table.ExpandTableColumn( NoOverlapBySupervisorDate, "Shifted", {"Start Time", "End Time"} ), AddedHours = Table.AddColumn(ExpandedTimeColumns, "Hours", each Duration.TotalHours( [End Time] - [Start Time] ), type number ) in AddedHours Updated workbook avail. at https://1drv.ms/x/c/1cd824d35610aacb/IQCkJLQ4qI2hQ6OG2-ntg7wiATHCsDR7AVWdpHB_O7bJjgs?e=xn9UML0Views0likes0CommentsRe: Viva Engage - Photos Not Loading in Conversations
Hi I had no idea what Viva Engage was (https://www.microsoft.com/en-gb/microsoft-viva/engage?msockid=09d76e3572d66fa03c657a1073916ee3). Obviously this has nothing to do with Excel - this forum. Suggest you post your issue in the appropriate Viva Engage community: > Select a Discussion Space (at the bottom of the page)16Views0likes0CommentsRe: Name Manager using for create name which is contain atleast two name.
Hi Harun24HR The OP got a couple of #NAME? errors with UNIQUE & VSTACK so wonder if those functions are avail. in the Excel version they run No news from RábaiBalázs for a few days so wonder if we'll ever know...18Views0likes0CommentsRe: Calculate overlapping hours
To reduce dependency on Records (could be "slow" on large tables) : 1) Provided Copilot code to replace its initial steps with a Table (vs. Records) approach 2) Provided it directions to build function BuildFlagTable 3) Asked it to integrate everything and add comments Copilot_NoOverlap_v2: // TableData let Source = Excel.CurrentWorkbook(){[Name="TableData"]}[Content], FilteredTime = Table.SelectRows( Source, each [End Time] > [Start Time] ), ChangedTypes = Table.TransformColumnTypes( FilteredTime, { {"Volunteer Name", type text}, {"Date", type date}, {"Start Time", type time}, {"End Time", type time}, {"Supervisor", type text} } ) in ChangedTypes // CopilotNoOverlap_v2 let Source = TableData, // Build a Time/Flag table for a given column and flag BuildFlagTable = (tbl as table, columnName as text, flag as number) as table => let Renamed = Table.RenameColumns( Table.SelectColumns(tbl, {columnName}), {{columnName, "Time"}} ), // Extract and rename to 'Time' WithFlag = Table.AddColumn( Renamed, "Flag", each flag, Int64.Type ) // Add flag (+1 or -1) in WithFlag, // Build combined Start(+1) and End(-1) table BuildTimeFlagsTable = (tbl as table) as table => let Starts = BuildFlagTable(tbl, "Start Time", 1), // Start events Ends = BuildFlagTable(tbl, "End Time", -1) // End events in Table.Combine({Starts, Ends}), // Append both tables Grouped = Table.Group( Source, {"Date", "Supervisor"}, // Group by Date + Supervisor {"Hours", (tbl as table) as number => let RowCount = Table.RowCount(tbl), // Count rows in group Result = if RowCount = 1 then // Single interval in group Duration.TotalHours( tbl[End Time]{0} - tbl[Start Time]{0} ) // Safe due to TableData filter else // Multi‑interval case let TimeFlagsTable = BuildTimeFlagsTable(tbl), // Build Start/End events SortedTimeFlagsTable = Table.Sort( TimeFlagsTable, { {"Time", Order.Ascending}, {"Flag", Order.Descending} } ), // Sort by Time, End before Start SortedTimeFlags = Table.ToRecords(SortedTimeFlagsTable), // Convert to list of records seed = [Active = 0, LastTime = null, Total = #duration(0,0,0,0)], // Initial accumulator TimelineState = List.Accumulate( SortedTimeFlags, seed, (state, current) => let currentTime = current[Time], // Current event time activeBefore = state[Active], // Active intervals before event total = if activeBefore > 0 and state[LastTime] <> null then state[Total] + (currentTime - state[LastTime]) // Add covered duration else state[Total], // No active coverage newActive = activeBefore + current[Flag] // Update active count in [ Active = newActive, // New active count LastTime = currentTime, // Update last timestamp Total = total // Updated total duration ] ) in Duration.TotalHours(TimelineState[Total]) // Convert duration to hours in Result, // Return hours for this group type number } ), SortedSupervisorByDate = Table.Sort( Grouped, {{"Date", Order.Ascending}, {"Supervisor", Order.Ascending}} ) in SortedSupervisorByDate Updated workbook at: https://1drv.ms/x/c/1cd824d35610aacb/IQCkJLQ4qI2hQ6OG2-ntg7wiATHCsDR7AVWdpHB_O7bJjgs?e=akf0vp0Views1like0CommentsRe: Calculate overlapping hours
Provided Copilot (ChatGPT 5.1 mode) the code of the Power Query marked as solution and asked: 1) Find an alternative ==> Worked 1st time 2) Add test in case there's only 1 record per Date & Supervisor group 3) Add comments Copilot_NoOverlap_v1: // TableData let Source = Excel.CurrentWorkbook(){[Name="TableData"]}[Content], FilteredTime = Table.SelectRows( Source, each [End Time] > [Start Time] ), ChangedTypes = Table.TransformColumnTypes( FilteredTime, { {"Volunteer Name", type text}, {"Date", type date}, {"Start Time", type time}, {"End Time", type time}, {"Supervisor", type text} } ) in ChangedTypes // Copilot_NoOverlap_v1 let Source = TableData, // Input table Grouped = Table.Group( Source, {"Date", "Supervisor"}, // Group by Date + Supervisor {"Hours", (tbl as table) as number => let RowCount = Table.RowCount(tbl), // Count rows in group Result = if RowCount = 1 then // Single interval in group Duration.TotalHours( tbl[End Time]{0} - tbl[Start Time]{0} ) // Safe because TableData filters invalid rows // Clamp negative durations to 0 else // Multi‑interval case let Starts = tbl[Start Time], // List of StartTime Ends = tbl[End Time], // List of EndTime TimeFlags = List.Combine( // Build Start(+1)/End(-1) events { List.Transform(Starts, each [Time = _, Flag = 1]), // Start event List.Transform(Ends, each [Time = _, Flag = -1]) // End event } ), SortedTimeFlags = List.Sort( TimeFlags, // Sort by Time, End before Start (a, b) => if a[Time] < b[Time] then -1 else if a[Time] > b[Time] then 1 else if a[Flag] < b[Flag] then -1 else 1 ), seed = [Active = 0, LastTime = null, Total = #duration(0,0,0,0)], // Initial accumulator state TimelineState = List.Accumulate( SortedTimeFlags, seed, // Walk timeline and accumulate coverage (state, current) => let currentTime = current[Time], // Current event time activeBefore = state[Active], // Active intervals before event total = if activeBefore > 0 and state[LastTime] <> null then state[Total] + (currentTime - state[LastTime]) // Add covered duration else state[Total], // No active coverage newActive = activeBefore + current[Flag] // Update active count in [ Active = newActive, // New active count LastTime = currentTime, // Update last timestamp Total = total // Updated total duration ] ) in Duration.TotalHours(TimelineState[Total]) // Convert duration to hours in Result, // Return hours for this group type number // Output type } ), SortedSupervisorByDate = Table.Sort( Grouped, {{"Date", Order.Ascending}, {"Supervisor", Order.Ascending}} ) in SortedSupervisorByDate0Views1like1CommentRe: Non-Consecutive Cell Referencing
MattKW1 Option from m_tarler is much better - from an efficiency perspective as well. If you want to stick to INDIRECT the following addresses his point re. locked column A on the Orig sheet, the sheet name remains locked though *: =INDIRECT( ADDRESS( QUOTIENT( ROW(B3)-ROW(B$3) +1, 5 ) +ROW(Orig!A$3), COLUMN(Orig!A3),,, "Orig" ) ) * A workaround exists with Excel >/= 201370Views1like0CommentsRe: How to write a script or any PQ or in Excel to download the zip files from a Webpage
anupambit1797 No worries at all re. the delay & glad you sorted out the next steps. Just checked How To update the initial post : Open the thread Click the gear at the top right of the window... Nice holidays too Best Lz.16Views0likes0CommentsRe: How to write a script or any PQ or in Excel to download the zip files from a Webpage
Hi anupambit1797 To help people who search for existing solutions could you please: Update the title of this thread to better reflect the challenge - ex. How to write a script or any PQ or Excel formula to download the pdf files from a Webpage Provide feedback/mark as solved if appropriate - Hope you saw the Better option that's more straightforward than the initial proposal Thanks & let me know if you need more help with this issue Cheers30Views1like2CommentsRe: Sumifs with Custom Excel Data type from power Query and using dot notation
Hi Here is a drop box link to my spreadsheet => Unfortunately there's no link in your initial post - Not necessarily your mistake as this site currently (& randomly ???) drops ex. file attachments and hyperlinks are bugging as well Could you try again please?41Views0likes0CommentsRe: Logical test for same text string existing anywhere in both ranges.
Hi Still with your Table4 a 365 option: =IF( SUM( IFNA( XMATCH( TOCOL( IFS(Table4[@[Dir1]:[Dir3]] <> "(n/a)", Table4[@[Dir1]:[Dir3]]), 2 ), TOCOL( IFS(Table4[@[Wri1]:[Wri4]] <> "(n/a)", Table4[@[Wri1]:[Wri4]]), 2 ) ), 0 ) ), "Y", "N" )11Views1like0CommentsRe: Calculate overlapping hours
Hi To help people who search for existing solutions it would be smart of you to revise the title of this thread with Calculate non-overlapping hours ;-) - Thanks With Power Query > Pivot Report: Added dummy records to those you provided. Looks good to me... #1 Please double-check and confirm (or not). Sample (to download) avail. at: https://1drv.ms/x/c/1cd824d35610aacb/IQCkJLQ4qI2hQ6OG2-ntg7wiATHCsDR7AVWdpHB_O7bJjgs?e=xn9UML #2 Let me know if you prefer a flat Table instead of a PivotTable Report How to use: With your data in TableData > Right-click somewhere in PivotTable Report > Refresh Notes: 1) If you double-click on a number in the [Total Hours] col. of the PivotTable Report a sheet will give you the details of what made that number. However, you might get less records than in TableData as the query filters out some records for perf. reason. As an ex. : on 11/06/25 Freddie has 9 records but double-clicking on his 10.5 [Total Hours] for that date you get 8 records. The one that's filtered out is: because [Start Time] > [End Time] 2) Also filtered out are records, where for the same [Supervisor] on a given [Date], we have duplicated [Start Time] & [End Time] 3) With the provided sample dataset, [Supervisor] Foo isn't reported as it has only 1 record where [End Time] = [Start Time]34Views3likes0Comments
Recent Blog Articles
No content to show