formulas and functions
25406 TopicsLambda that uses INDEX with array arguments behaves inconsistently when saved in the Name Manager
Hello, I have encountered what appears to be inconsistent behavior when a particular type of lambda is saved in the Name Manager. The issue seems to occurs when the LAMBDA uses INDEX with either the row_num or column_num argument supplied as an array. The following is a minimal reproducible example: The formula "=LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4})" correctly evaluates to {1,2,4}. Now, save the lambda as TEST (or any other name) in the name manager. The formula "=TEST({1,2,3,4})" also spills the expected array {1,2,4}. However, when the result is passed to another function, the behavior changes. For example, "=SUM(TEST({1,2,3,4}))" and "=COLUMNS(TEST({1,2,3,4}))" both evaluate to 1. In contrast, using the lambda inline instead of the defined name produces the expected results: "=SUM(LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4}))" returns 7, and "=COLUMNS(LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4}))" returns 3. Unfortunately, I am unable to attach a workbook to this post. Additionally, the issue is not reproducible on every machine I have tested, although it is consistently reproducible in Excel for the Web. I am currently using Excel version 2607 on the Current Channel. Does this appear to be expected behavior, or is it a bug? In the meantime, what would be the best way to mitigate this issue? I have found two potential workarounds. The first is to prepend the result of the named lambda with a unary + (e.g "=SUM(+TEST({1,2,3,4}))"), which appears to force excel to treat the result as an array. However, when using a shared lambda library (as is the case for most of my team), users generally do not know the implementation details of each lambda, so it is difficult to determine when this workaround is necessary. The second approach is to avoid passing an array to the row_num or column_num argument of Index by using MAP. For example, the TEST lambda defined above can be rewritten as =LAMBDA(arr,MAP({1,2,4},LAMBDA(idx,INDEX(arr,1,idx)))), which causes it to behave as expected. However, I am concerned about potential performance implications. Intuitively I would expect that a single INDEX call with an array argument would be more efficient than multiple INDEX calls wrapped in MAP, but I do not know whether this is the case. Has anyone else encountered this behavior before?198Views0likes7CommentsDisplaying Time in hours
I have a spread sheet where I record my work hours. Eg: 0700 (A2) - 1530 (A3) which equals 8 1/2 hours, then I take 30 minutes off for a lunch break, which leaves me with 8 hours. My formula is A3-A2-30 which brings up the result as 800.00. I have tried all different methods and formulas but I can't get the hours to show as 8.00. I then use the 8.00 hours in another formula to work out my pay for the day. Please help.Solved66Views0likes5CommentsNesting a COUNTIF With IF To Evaluate A Formula
I have a sheet called Employee Training Matrix that I use to lookup data in a tab called Documents to see if there has been a date entered into a range of cells. Depending on how many dates are entered, the sheet will calculate the percentage where a person has been trained for a particular job. For example, the safety training requires three documents, so the formula I use for this lookup is "=COUNTA(Documents!C3:C5)/3". The issue is that some people do not require training in some areas, so I want to have the sheet to return a blank cell that I will format with a conditional format rule. Is there a way to do an IF and COUNTIF formula that will return a blank cell on one sheet when the second sheet has no date and run my COUNTA formula if there is? Or is there another way to address this? Thank you.Solved102Views0likes5CommentsExcel formula to get sheet name from a cell
I am trying to use a formula to reference a worksheet by getting the sheet name from a cell as shown below =IF(A34="","",MAX(Client10!C$3:C$33)) I have about 50 sheets and want to sect the sheet depending on the row. I have tried to use CONCAT to build the sheetname but cannot get it to work in the formula. All the sheets start with Client and column A contains a number which needs to be added to Client to give me the sheetname.8.6KViews0likes6CommentsFormula getting data from sheets with different names
Hello, I have a file with 12 different sheets (one for each month) that all have the same format. I’m creating a new sheet with graphics. To feed this graphics, I created a table (on this new sheet) that gets data from page Jan23, for example cells A5, B5 and C5. So the cell on the new page says: ‘Jan23’!A5. I also have a drop down list (on this new page) with the names of all the 12 pages (12 months). What I wanted to do is that the cell that has the formula (‘Jan23’!A5) could replace the name of the sheet by the one I select on the drop down list. Is this possible to do?Solved1.1KViews0likes2CommentsIs it possible to do this?
Hey all! I currently use Smartsheet to track my trainees' progress and I love the way I can use Conditional Formatting in that program. Unfortunately, my company is going away from using Smartsheet, so I need to move all the information I have to an Excel document. I'm struggling with getting the Conditional Formatting to work the same way I have it in Smartsheet and I'm curious if it's even possible. Here is an image of the Template I will be using for each employee. My plan is to have a tab for each employee, just duplicating the template and renaming it to their name and adding their information. Here are the two things I'm struggling with getting set-up with Conditional Formatting: 1. In the Lvl column, I have a drop down that is linked to the Data tab where the icons on the left are images. I want to be able to select the "Assigned" option and have the A icon show up (this is currently set up) and then have the fill of the box turn to red. I'm struggling to get that to work properly. Currently, when I select the "Assigned" option in the drop-down menu, it just shows the "A" icon. 2. I also want to be able to have the "Date Completed" column change to a specific color if one of the checkbox columns (G, H, I, J, K) are checked (i.e. if G is checked, it turns a light brown, if H is checked, it's gray, if I is checked, then it's red, etc.). This is what it looks like in Smartsheet and how I'm hoping to get it to look in Excel: Thank you!6Views0likes0CommentsPython in Excel 365 returns #CONNECT! in desktop and web
When I try to enter a simple Python expression (like "PY 1+1" ) in Excel 365 Desktop version or Web-version, I get "#Connect!" mistake in Excel Cell. When I try to run Formulas->Python->Initialization, I get error text: "Error: We weren't able to retrieve this value. We recommend restarting the external code service environment." Simple restarting Python Environment with the help of "Reset" or "Reset Runtime" do not solve the problem. I use Windows 11, Office 365 (family). PS. I would be happy if somebody could help to solve. As for now, standard Microrsoft Suport recommended to ask for a solution in TechCommunity.Microsoft.Com50Views0likes1CommentExcel as a basis of construction costing of roofing
Does anyone have a sample spreadsheet that I could use for IDA hurricane damage related to removing and replacing a roof with about 4400 sq ft. The slope is 22 degrees and a hip type roof using 3 tab shingles over Titanium underlayment. The deck does not conform to Dade county standards because the 1970's construction used 2" by 6" wooden planks. New standards require 4' x 8' sheathing that is about 3/8" thick. The new sheathing is permitted to be installed over existing wood planks. See attached sample of constraints.816Views0likes1CommentCalculate downtime
Hello all, I am looking for help. I would like to calculate the downtime of a machine in Excel. for this I need the difference in minutes between the start time and stop time. The only exception is that the machine produces on working days from Monday to Friday from 6am to 11pm. so if the machine breaks down on Friday 10:50 PM and the fault is resolved on Monday 6:10 AM, 20 minutes of downtime must be calculated. I have tried everything but I cannot find the right combination of formulas. does anyone know if this is possible? example: Start: 9/1/2023 6:00:00 PM Stop: 9/1/2023 8:13:00 PM Result: 133 Start: 9/1/2023 9:15:00 PM Stop: 9/2/2023 8:13:00 PM Result: 105 Start: 9/3/2023 9:00:00 AM Stop: 9/3/2023 8:30:00 PM Result: 0 Start: 9/1/2023 10:15:00 PM Stop: 9/4/2023 8:00:00 AM Result: 165Solved9.9KViews1like18CommentsWelcome to the Excel Community
The Excel Community is a place we've built for all of you. You can learn more about how to do something with Excel, discuss your work, and connect with experts that build and use the product. With over half a billion Excel customers, we want to engage with you in fundamentally different ways and the community is a starting point for that. Our community helps answer your product questions with responses from other knowledgeable community members. We love hearing feedback and feature requests from you which helps us build the best version of Excel ever. If you have found an outage or a bug please post at our Answers forum. We look forward to getting to know you! Sangeeta Mudnal & Olaf Hubel on behalf of the Excel Team66KViews30likes102Comments