I am having so much trouble trying to find my answer that I thought I would ask my question here.
In one column (column A) I have names of girls and in another column (column C) I enter the pay for each girl. Further down my sheet I have each girl's name per column, on the same line, and I want to have the pay to be copied under each girl's name.
For example when I enter in cell C4 the number 5, I would like this number to be copied to cell E4 automatically, so that I only have to enter it once. See the attached image:
The data from cell C5 should be copied to cell F4. I am having trouble using the VLOOKUP since each girl's name will be in the column A more than once.
In E4 enter the array formula:
=IFERROR(INDEX($C$2:$C$8,SMALL(IF($A$4:$A$8=E$3,ROW($A$4:$A$8)),ROWS($2:2))-1),"")
Copy both downward and across:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
Try putting this in E4 then filling both right and down.
=iferror(index($c:$c, aggregate(15, 6, row($4:$999)/($a$4:$a$999=e$3), row(1:1))), text(,))
Related
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
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
As seen , I am trying to get the cell address of the origin data, without duplicates. The can be done partially by =address(index match). I want C19 to show the value of B8 in the above picture.
For the Name, use INDEX with AGGREGATE providing the position within adjusted by the duplicates with COUNTIF.
If you have to have the cell address, adjust the same AGGREGATE formula to return the actual row on the worksheet but don't use this with INDIRECT to achieve the Name.
'for the name in C19
=INDEX(A$5:A$12, AGGREGATE(15, 6, ROW($1:$8)/(B$5:B$12=B19), COUNTIF(B$19:B19, B19)))
'for the cell address in D19
=ADDRESS(AGGREGATE(15, 6, ROW($5:$12)/(B$5:B$12=B19), COUNTIF(B$19:B19, B19)), COLUMN(B:B), 4, 1)
Fill down as necessary.
Try this Array formula:
=INDEX($A$5:$A$12,MATCH(1,IF(($B$5:$B$12=B19)*(COUNTIF($C$18:$C18,$A$5:$A$12)=0),1,0),0))
Being an Array formula; copy and paste this into the formula bar for cell C19. Press Ctrl-Shift-Enter to exit edit mode instead of enter or tab. If Excel puts {} around the formula, it has been properly entered as an array formula.
Then copy down.
I wonder if you can help, I am working on a spread sheet where Column B is populated with data.
What I want to be able to do is to say (using b3 as an example)
If B3 is populated then A2+1. I am using this formula in cell a3:
=IF(B2 > 0, A2 +1)
which gives me the result I want but when I hit a blank cell in B it starts the count over again. so I tried:
=IF(B2 > 0,A2 +1,A1 + 1)
but that counts my blank spaces. I need it to continue the count from the cell above without counting blank spaces. I have also tried applying the formula through pentaho to no avail.
It would be good if the formula actively looked and populated Column A instead of a manual formula having to be copied.
I have also used the COUNTIF function but I don't seem to be able to get it to work.
I hope this makes sense.
With column B like:
Place a starting value in A2 and in A3 enter:
=IF(B2>0,MAX($A$1:A2)+1,"")
and copy down:
I have a rather complicated data structure in Excel (Google Drive link). I would like to get certain values from this table:
I tried a combination of a row-column INDEX MATCH. However this did not work because I do not know how to locate the desired column.
Any suggestions how to transform this data structure?
Add two helper columns in M and N.
In M4 enter:
=MATCH(H4,A:A,0)
IN N4 enter:
=COUNTIF(A:A,H4)-1+M4
These will return the first and last row numbers for the Group.
Then in J4, array enter:
=INDEX(INDEX(INDEX($D:$D,$M4):INDEX($D:$D,$N4),MATCH(J$3,INDEX($D:$D,$M4):INDEX($D:$D,$N4),0)+1):INDEX($D:$D,$N4),MATCH(1,1/(INDEX(INDEX($B:$B,$M4):INDEX($B:$B,$N4),MATCH(J$3,INDEX($D:$D,$M4):INDEX($D:$D,$N4),0)+1):INDEX($B:$B,$N4)=$I4),0))
Remembering to confirm with Ctrl+Shift+Enter. Then fill across and down as needed.
There's probably a simpler version!
If you can add a helper column A you can do the following
A3: =E4, A4: =E4, A5: =E4, A6: =E4, A7: =E8...
Once you have the first four values you can drag it down for the frist group and then from group 2 drag those four formulas down to the end.
You data will look like this:
Then in Cell K4 you enter the following formula:
=SUMIFS($E$3:$E$26,
$A$3:$A$26, K$3,
$B$3:$B$26, $I4,
$C$3:$C$26, $J4)
Once you have this you can drag it down and right arbitrarily.
The only issue here is getting the Dates into the helper column, the approach above is only easy if all groups are of equal size but I assumed that given the sample data.
This solution does not required working (helper) cells, just a minor adjustment to your output table:
Enter the word Date in cell I3
Then enter this FormulaArray in cell J4 then copy till J7 then to range K4:L7
(Formulas Array are entered by pressing [Ctrl] + [Shift] + [Enter] simultaneously)
=INDEX($D$2:$D$26,
MATCH($H4&$I$3&J$3,$A$2:$A$26&$B$2:$B$26&$D$2:$D$26,0)
+MATCH($I4,OFFSET($B$2:$B$26,
+MATCH($H4&$I$3&J$3,$A$2:$A$26&$B$2:$B$26&$D$2:$D$26,0),0),0))