Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 months ago.
Improve this question
I have the following excel file
The user will enter the number of the levels (3 levels in the example) then using sequence function it will be showed in the level columns colored light blue automatically. Then, the user should enter the sub-clause next to each level. My desired outcome is I would like the Level & Sub-Clause 1 column to be filled with the following list based on the user entry as mentioned before:
1
1.1
2
2.1
2.2
2.3
3
3.1
3.2
is it possible?
With TOCOL,MAKEARRAY inside a LET with FILTER to remove the blanks:
=LET(
r,B1,
l,B4#,
sc,C4:INDEX(C:C,4+r-1),
cl,TOCOL(MAKEARRAY(r,MAX(sc+1),LAMBDA(a,b,IF(b=1,INDEX(l,a),IF(b-1>INDEX(sc,a),"",INDEX(l,a)&"."&b-1)))),3),
FILTER(cl,cl<>""))
=TEXTSPLIT(TEXTJOIN("-",,BYROW(B6:INDEX(C:C,MAX(ROW(B6#))),LAMBDA(br,TEXTJOIN("-",,INDEX(br,,1),INDEX(br,,1)&"."&SEQUENCE(INDEX(br,,2)))))),,"-")
Edit: forgot about the single level at first. Updated the formula and screenshot to include it.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 months ago.
Improve this question
I'd like make a task for my work way more simple, but in pretty lost since I'm just starting to learn VBA.
What I wanna make easier is a process of removing certaing data from an excel sheet.
Please, see the image, I think it's easier to understand.
I'd like to ask for an input of a market in column P. Let's say the user enters "Portugal". Then it would look for the rows that have that value in column P and delete the ones that doesn't contain information for Portugal (e.g. it would delete rows from 6 to 9 and 21 to 25, but rows 2-5 and 10-20 should not be deleted).
Any good ideas? I think it should be simple somehow but I can't think of any solution.
Thanks
Let me teach you some Excel magic:
Select the entire column "P".
Press Ctrl+G , choose "Special" and then "Blanks".
Click in the address bar and type =P2.
Press Ctrl+ENTER (don't forget the Ctrl button!)
This should fill in the "P" column as you desire and from then on, you can use the basic autofilter.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am trying to create a new colunm in a df that returns number of elements of a column row by row.
I tried this
df['Elements'] = len(df['Goals']) sadly all I get is column full of the same number, I understand what is returning are not the elements that the columns 'Goals' has in every row but all the elements included in the column 'Goals' in total. I do not know how to get the len() of the list included in the row.
Could someone help me, I would really appreciate it
I think you're looking for str.len():
https://pandas.pydata.org/pandas-docs/stable/user_guide/text.html
df['Elements'] = df['Goals'].str.len()
You can do it with pandas.Dataframe.apply:
df['Elements'] = df['Goals'].apply(len)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a large amount of data that was converted to excel recently.
There are just two columns and more than 100000 lines. There is an Image as an example attached here.
The systems are always in the second columns as well as the data, but the loads and the rest of the information are in the first column, as you can see in the example, the "Max load" always repeat, but in the system 001 there is a difference of two lines between it and the system name, but in the second system the difference is three lines. I want to make a table for Max load with all the systems, those are the things I tried:
I used MATCH to find the line where the System name appears, knowing that the difference would be either 2 or 3 lines, I made a table with 2 and 3 in the header and I added it to the line I found and MATCH, it kind of work, but I wanted something better than this improvisation.
I also tried using (where X2= the line where the system name appears)
=MATCH(AA1;OFFSET(A1:X2:0:100:1);0)
Because I thought that OFFSET would return a range to MATCH, but it didn't work.
I want to know if there is a way to find the text "Max load" after the line I found using the Systems' names in MATCH. Basically, I want to know if there is a way of using kind of a "dynamic array" inside MATCH, so I would use it to find "Max load" right after the system that I am looking for.
I don't if this works, but if there is any other way of doing it, I am glad to know about it.
Thanks very much,
Matheus
You can use multiple match with index. Use below formula. It will not care how many rows are different from system to data.
=INDEX(D:D,MATCH(H4,D:D,0)+MATCH("Max Load",INDIRECT("C" & MATCH(H4,D:D,0) & ":C200000"),0)-1)
I think you are overthinking this way too much. If you just have either two or three rows, if offsetting the answer by 1 gives you 0 then use a simple if statement to offset it by 3.
=IF(INDEX(E:E,MATCH(H3,E:E,0)+2)>0,INDEX(E:E,MATCH(H3,E:E,0)+2),INDEX(E:E,MATCH(H3,E:E,0)+3))
Another option
In I4, formula copied right to J4 and all copied down :
=INDEX($D:$D,AGGREGATE(15,6,ROW($C$6:$C$1000)/($C$6:$C$1000=I$3),ROW($A1)))
Another solution would be
=INDEX(INDEX($D:$D,MATCH($F4,$D:$D,0)):$D$200000,MATCH(G$3,INDEX($C:$C,MATCH($F4,$D:$D,0)):$C$200000,0))
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I'm using the following formula to extract a string from text in a cell by getting rid of -DCS.
The text contained in the cell: Q074-SARE_MANSONG-DCS
Formula:IF(ISNUMBER(SEARCH("DCS",H22)),LEFT(H22,FIND("#",SUBSTITUTE(H22,"-DCS","#",LEN(H22)-LEN(SUBSTITUTE(H22,"-",""))))-1),([#[<HELPER><SITE>]]))
Desired reslut: Q074-SARE_MANSONG
The problem is that it is not working for all cells. Can someone please tell me what it is that I'm doing wrong. Thanks.
If "-DCS" is always at the end of the string:
=SUBSTITUTE(A1,"-DCS","")
Use one of these formulas instead (assuming your data is in A1)
=left(A1,len(A1)-4) or =SUBSTITUTE(A1,"-DCS","")
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am looking for a way to automate checking a demographic sheet filled in by a trainee against an answer key.
Our sheet currently has data validation built in to return TRUE or FALSE on whether the answer matches the answer key, but I'm looking for a way to then display the exact text string, so as to provide feedback on the exact error.
For example the way it currently functions is:
Sheet1!A1=Cat
Sheet2!A1=Dog
Sheet3!A1=FALSE
What I'm looking for, is a to utilize VBA to generate a comment balloon on Sheet3!A1 and see the exact error for easier feedback.
I'm new to working with advanced functions in Excel, so if anyone has a pointer in the right direction, I would greatly appreciate it!!
I Suppose your want to check Sheet1 = Sheet2 in sheet3, and show the error if does not match.
To make it simple, just use formula in sheet 3,
=IF(Sheet1!A1=Sheet2!A1,"",Sheet1!A1 & "|" &Sheet2!A1)
if they match, nothing will be show, if they don't match, it will show Sheet1figure|Sheet2figure
this is easier than showing True/False