Simple one for someone hopefully. I'm trying to get the max length of each column in an excel sheet but it doesn't seem to be working now. I was using =MAX(LEN(A2:A200)) for example and because MAX is not an "official" formula but is still there you seem to have to press CTRL + ALT + SHIFT once you have finished typing it.
When I do this it puts curly brackets round the whole formula like this {=MAX(LEN(A2:A200))} but if I click into the cell they disappear. the length of the first column will appear but then if I autofill to the next column it shows same length of column data from the first column rather than calculating the next column.
Perhaps not a straight up programming question but scratching my head why this is not working now. I'm trying to show max length of each column above header column in new row.
Thanks
Andrew
In A1 enter the array formula:
=MAX(LEN(A2:A200))
then stop clicking.
Move to A1 with the ARROW keys. Touch Ctrl+c. Then paste to B2 through G2 using Ctrl+v:
This will put the array formula in the destination cells.
Use Gary's formula and instead of ENTER, do CTRL-SHIFT-ENTER
When I do this it puts curly brackets round the whole formula like this {=MAX(LEN(A2:A200))} but if I click into the cell they disappear. the length of the first column will appear but then if I autofill to the next column it shows same length of column data from the first column rather than calculating the next column.
It is right to use formulas with brackets (they are called Matrix formulas). The brackets disappears because when you edit the content of the cell you have to push Ctrl + Shift + Enter and not only Enter like normal formulas.
Let's assume all your data is in Sheet1 starting at cell A1.
Create Sheet2
Enter the =LEN(Sheet1!A1) formula in cell A1 on Sheet2
Pull Sheet2's A1 cell down/over to the right to cover the populated
range of Sheet1 (to copy the formula to every cell of the range in
scope) - this will give you the length of every cell in scope
Enter the =MAX(A1:A10) formula on Sheet2 in the first column below
the last line (A10 is assumed to be the last line of the first
column in this example - so the formula goes in A11)
Pull Sheet2's A11 cell over to the right till the last column to get
the MAX length of values for each column
Related
I want to compare data between two tables on excel and get the cells that match in two columns.
i.e:
Look for the value from cell G9 in column A, if found the check if the value of cell J9 Equals to cell D of the row in which the first match was found.
I tried Vlookup, index and match, but I'm still missing a function to complete the syntax
=IF(VLOOKUP(G9,$A$9:$D$1127,1,FALSE),IF(J9=D,"","new"),"new")
I don't know what to insert instead of D
Sample: https://drive.google.com/open?id=1aJZlpQ2V-bmwmS1Kwk-OIiSvXR552JJH
You can use MATCH on an array premises. If you want the number of the line when the values of G9 and J9 occur on columns A:A and D:D simultaneously, use the formula:
{=IFERROR(MATCH(J9,IF(A:A=G9,D:D),0),"No Match")}
If you want to return just the word "new" in case of a valid match use:
{=IFERROR(IF(MATCH(J9,IF(A:A=G9,D:D),0)>0,"new",""),"")}
Don't forget to use Ctrl + Shift + Enter to place the braces on the formula.
EDIT:
Since I'm having some troubles with showing my solution, I'll be more thorough.
Let's imagine you have the following worksheet:
For each row in the first table, if you want to check a match on the second table, you could place the formula
{=IFERROR(IF(MATCH(A1,IF(E:E=B1,D:D),0)>0,"new",""),"")}
on cell C1 and drag it to the end (to C22 on my example). You will get the next result:
Please, don't forget to press Ctrl + Shift + Enter when you're entering the formula on cell C1.
In the table shown, I need a formula for column D that will indicate the first date (minimum) and most recent date (maximum) that each participant (in column A) took survey A (in column C). Column D would need to indicate "first" and "last" tied to the Participant ID--for example, I would want D2 to populate with "3Last" and D5 to populate with "3First." Column E displays what I would need column D to display. If it's not a first or last date (something in between), or if it's not survey A, the cell in column D would be left blank or 0. If there is only one date that meets the criteria, it should return "First" rather than "Last." I'm pretty stumped on this one... Any help is much appreciated!
In E2, insert the ARRAY formula listed below. If you have never used an array formula, follow these steps:
select the formula from this page
copy it
go to excel
select cell E2,
press the 'F2' key
paste the formula
press CTRL+SHIFT+Enter (instead of just pressing enter)
To copy down, follow these steps:
Copy cell E2
Move down to cell E3 (instead of selecting a range)
Paste in cell E3
Select your range and paste from there.
If you don't copy down in this manner, it will tell you that you cannot change the array...
=IF($C2="A",IF($B2=MIN(IF(($C$2:$C$7=$C2)*($A$2:$A$7=$A2),$B$2:$B$7)),CONCATENATE($A2,"Last"),IF($B2=MAX(IF(($C$2:$C$7=$C2)*($A$2:$A$7=$A2),$B$2:$B$7)),CONCATENATE($A2,"First"))),0)
HTH
I use this formula to align cells like here
I put this formula in E3 and then I press CTRL+SHIFT+ENTER
=INDEX($D$3:$D$6,MATCH("*" & MID(B3,SEARCH("http",B3),99),$D$3:$D$6,0))
The formula stops at the first step, but does not consider that the function that values do not align correctly, that is what I seek.
if I change position of cells of column D formula return me this error:
#VALUE!
Look this pic, please:
Is there any solution to correct position of cells of column E with column D after first formula alignment between B-D?
Note: alignment must following same LINK and It should value the same function as a loop. Loop because function must look at the alignment with the neighboring column, in our case is the D until e.g http://beta.com link is on the same row level. They could take more steps, but eventually you have to get to an array. P.S: each link of start column (B) is unique
Simply put in E3:
=IF(D3<>"",INDEX(D:D,MATCH("*"&MID(INDEX($B$3:$B$6,COUNTIF($D$3:$D3,"<>")),SEARCH("http://",INDEX($B$3:$B$6,COUNTIF($D$3:$D3,"<>"))),999),D:D,0)),"")
and copy down. this is NOT an array formula.
EDIT
If I got you right, then all you want is to flip over the original formula...
=IF(D3="","",INDEX(B:B,MATCH("*" & MID(D3,SEARCH("http://",D3),999),B:B,0)))
For instance i have a range "B3:AY3" and first non blank cell that contains value is "R3", i need to count all blank cells after cell "R3"
This formula must be array-entered:
A3: =COUNTBLANK(OFFSET(MyRange,0,MATCH(
TRUE,LEN(MyRange)>0,0)-1,1,COLUMNS(
MyRange)-MATCH(TRUE,LEN(MyRange)>0,0)+1))
where MyRange = B3:AY3
and fill down as needed
To array-enter a formula, after entering
the formula into the cell or formula bar, hold down
ctrl-shift while hitting enter. If you did this
correctly, Excel will place braces {...} around the formula.
The above formula will return an error message if there are ONLY blank cells in the range, or if there are any cells in the range which contain an error. If that is a problem, use the following array-entered formula instead:
=IFERROR(COUNTBLANK(OFFSET(MyRange,0,MATCH(
TRUE,IFERROR(LEN(MyRange)>0,TRUE),0)-1,1,COLUMNS(
MyRange)-MATCH(TRUE,IFERROR(LEN(MyRange)>0,TRUE),0)+1)),COLUMNS(MyRange))
IT will count errors as being non-blanks, and count all the cells if all are blank.
and first non blank cell that contains value is "R3"
I have taken the example for Row 1. Amend as applicable :)
Try This
=COUNTBLANK(INDIRECT(ADDRESS(1,MATCH(TRUE,LEN(A1:AY1)=0,0)) & ":AY1"))
Enter this as an Array Formula. i.e you have to press Ctrl + Shift + Enter instead of Enter
For 3rd row, the formula becomes
=COUNTBLANK(INDIRECT(ADDRESS(3,MATCH(TRUE,LEN(A3:AY3)=0,0)) & ":AY3"))
If you only need it to work for row three then use the following:
=COUNTBLANK(B3:AY3) - (MATCH(TRUE,INDEX((B3:AY3<>0),0),0)-1)
This is a regular formula and will not need to be entered as an array, also as I am not using any Volatile function (like INDIRECT and OFFSET) in should also be much better performance wise.
All I m doing is counting all blanks, then subtracting all the blanks before the first cell with a value.
I have a libreoffice sheet that I would like to have the rows increase by 1
example:
1
2
3
4
The problem is I know I can do this with autofill but I have 50000 rows and dragging down takes awhile.
Thanks
Assuming that you already have data up to row 50'000, and you have an empty column (I'll use Col. A) for the series.
Jump to the last cell in one of the "used" columns Ctrl + Arrow down (or scroll all the way down to Cell A50000) then move sideways to Col. A and place an "X" in cell A50000. You now have an empty column A, with an "X" in cell A50000.
Go to cell A1 ( Ctrl + Home ). Put the number "1" in cell A1. Put the following (secret!) formula in cell A2:
=A1+1
Copy cell A2 with Ctrl+c
Stay in Cell A2...
Press Ctrl+Shift+Arrow down, The area from A2 to A50000 should now be highlighted.
Press Ctrl+v to paste the formula all the way down...
IMPORTANT!
Press Ctrl+c to copy the just pasted data (A2..A50000).
Press Ctrl+Shift+v to paste the just copied data "over" the original data with "paste special".
In "Paste Special" make sure that you have NOT selected the option: Formulas.
This will now paste all the results of the formulas back as fixed numbers.
This should take less than a minute, of which most of it is waiting for the system to calculate and to paste (I tried it for 1 mio lines..)
By just changing the formula from =A1+1 to =A1+2, jou can jump with 2, so 1,3,5,7,... But I assume that you'll use this column as a reference for sorting, so you can always go back to the original order.
Have fun!