User Profile
Lorenzo
Silver Contributor
Joined 9 years ago
User Widgets
Recent Discussions
Re: 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)10Views0likes0CommentsRe: 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...5Views0likes0CommentsRe: 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 >/= 201341Views1like0CommentsRe: 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.12Views0likes0CommentsRe: 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 Cheers21Views1like2CommentsRe: 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?28Views0likes0CommentsRe: 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" )6Views1like0CommentsRe: 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]9Views2likes0CommentsRe: Conditional data validation drop downs
Hi Assuming your data is on Sheet1 with Names in A2:A5: Create a new Sheet2 (you can hide later): #1 On Sheet2 in A2 then copy right as necessary: =FILTER( Sheet1!$A2:$A5, Sheet1!B2:B5 = "available", "" ) #2 Switch to Sheet1 > In Data Validation on B7 and copy right as necessary: =Sheet2!A$2# (Don't forget the # sign at the end) Sample at: https://1drv.ms/x/c/1cd824d35610aacb/IQBN8UpV0kxfQJ5AFzs1WF3hARCxMpkCqNADQBR6vtlVPMY?e=uaMDfX9Views0likes0CommentsRe: Data Pulling
Hi No feedback/mark as solved on your previous case (Add Letter Into Number) - this doesn't encourage people to respond… You seem to have a relatively complex workbook + it's not obvious how you get the desired result. Not sure someone will spend time re-creating existing data, running the risk it doesn't reflect the reality Suggestion : Share - with OneDrive, Google Drive… - your workbook inc. your current PivotTables Indicate which version of Excel you run + on which platform (Windows, Mac, Web…)35Views0likes0CommentsRe: Name Manager using for create name which is contain atleast two name.
Hello #1 Unclear to me what you actually expect to achieve. Below is what I understood: One column values from each Table to be combined as a single list. Then keep unique values only. If this isn't what you expect post a similar picture with your Tables + the expected result #2 What version of Excel do you run + on which platform (Windows, Mac,...)?35Views0likes0CommentsRe: show a due date using data from multiple columns
Alternative with PIVOTBY Credit due djclements (Unpivot/repivot option in Need help with excel | Microsoft Community Hub) =LET( source, TAKE(Table1[#All],, 7), body, DROP(source, 1), today, TODAY(), startWeek, today - WEEKDAY(today, 2) +1, endWeek, startWeek +6, dueValues, DROP(body,, 2), arrDueThisWeek, (dueValues >= startWeek) * (dueValues <= endWeek), IF( SUM(arrDueThisWeek), LET( headers, TAKE(source, 1), dueHeaders, DROP(headers,, 2), pvtRows, TOCOL( IFS(arrDueThisWeek, SEQUENCE(ROWS(dueValues))), 2), HSTACK( VSTACK( TAKE(headers,, 2), CHOOSEROWS(TAKE(body,, 2), UNIQUE(pvtRows) ) ), DROP( PIVOTBY( pvtRows, TOCOL( IFS(arrDueThisWeek, dueHeaders), 2), TOCOL( IFS(arrDueThisWeek, dueValues), 2), SINGLE,, 0,, 0 ),, 1 ) ) ), VSTACK( "Comment", "Nothing due this week" ) ) )4Views0likes0CommentsRe: How to write a script or any PQ or in Excel to download the zip files from a Webpage
A better option: let Source = Web.BrowserContents( "https://www.etsi.org/deliver/etsi_ts/138300_138399/138306/" ), UrlRoot = "https://www.etsi.org", // All Parent 'directory' link end with ".00_60/" ParentLinks = Html.Table( Source, { {"Parent_Link", "a[href$='.00_60/']", each UrlRoot & [Attributes][href]} } ), PdfContents = Table.AddColumn( ParentLinks, "PdfContents", each let childContents = Web.BrowserContents( [Parent_Link] ), // Only one pdf file in sub-directory pdfLink = Table.FirstValue( Html.Table( childContents, { {"Pdf_Link", "a[href$='.pdf']", each UrlRoot & [Attributes][href]} } ) ) in Pdf.Tables( Web.Contents( pdfLink ) , [Implementation = "1.3"] ), Table.Type ) in PdfContents EDIT: CSS Selectors: https://www.w3schools.com/cssref/css_selectors.php let OneParentLink = Web.BrowserContents( "https://www.etsi.org/deliver/etsi_ts/138300_138399/138306/15.02.00_60/" ), UrlRoot = "https://www.etsi.org", // Get <a href>'s ending with '.pdf' OptionOne = Html.Table( OneParentLink, { {"Pdf_Link", "a[href$='.pdf']", each UrlRoot & [Attributes][href]} } ), OptionTwo = Html.Table( OneParentLink, { {"Pdf_Link", "a", each UrlRoot & [Attributes][href]} }, [RowSelector = "a[href$='.pdf']"] ) in OptionTwo12Views0likes0Comments
Recent Blog Articles
No content to show