Excel : How Can I Get First Cell Content - excel

How Can I Get First Cell Content ?
here is my sheet
A
1 Color
2 Red
3 Blue
4 Yellow
note : Color has filter
i want to make the cell B1 = first cell of column A - I try type in B1 =A2
but when i make filter (example i select blue) the cell B2 show nothing (i want B1 to show the filtered data on first column )

A Non-Volatile AND Non-Array entered option is to use a helper column:
In B2 Enter =SUBTOTAL(3,A2) and drag it down. This will mark every row with a 0 or a 1 depending on if it is visible or not.
Then in B1 you can simply enter:
=INDEX(A2:A4,MATCH(1,B2:B4,0))
The above will search the B column for the first 1 (stands for visible), and return the value of the cell in column A of that row.

In B1 enter the array formula:
=INDEX(A2:A100,MATCH(1,SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW($A$2),,1)),0))
Array formula must be entered with CNTRL-SHFT-ENTER rather than just the ENTER key

Related

Formula to find the last populated cell in a column and add to it?

If column A is marked with an X, the adjacent cell in column B will find the last populated cell in column B and simply +1 to that.
For example: If A1 is marked and B1 is HF2056, and it skips a row so that A3 is marked with an X, B3 would need to auto fill to be HF2057.Image with fake numbers for example
So how do I formulate it so that if a cell in column A is marked with an X, the adjacent cell in column B will find the last filled cell in B with data and fill in the new number?
I feel like this may be an ISBLANK formula but I can't figure it out.
Thank you in advance!
Assume : A1 is X and B1 is HF2056, A2 is blank, A3 is X
Then, in B2, formula copied down :
=IF(A2="","",LEFT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),2)&RIGHT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),4)+1)
And, formula result:
B2 : (blank)
B3 : HF2057
Remark :
The above formula result will give max number in HF10000.
If you want the number keep to increase by 1, the B2 formula will be changed to :
=IF(A2="","",LEFT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),2)&RIGHT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),LEN(LOOKUP(1,0/(A$1:A1="X"),B$1:B1))-2)+1)

count row and make max permutation

How can I make permutation of name list? For ex. I have 5 names on A column. Firstly count A column and give me only permutations 5 ly to b column in cell with separete "," changing only the first names...
Column A
tom
Lila
John
sam
steave
Column B
Tom,Lila,John,Sam,Steave
Lila,Tom,John,Sam,Steave
John,Tom,Lila,Sam,Steave
Sam,Tom,Lila,John,Steave
Steave,Tom,Lila,John,Sam
This is a fairly simple one:
In Cell B1 enter this formula: =A1&","&A2&","&A3&","&A4&","&A5
This will build a string from all cell values with a , in between them.
Then in B2 enter this formula: =A2&","&SUBSTITUTE($B$1,","&A2,"") and drag down.
It will start with the value of cell A2, add a comma and then add the string from cell B1 in which it substitutes the value in cell A2 with ""(no character), effectively removing it from the string.
Edit as per comment from OP
(Adapt range A1:A10 as needed)
To make this responsive I have added a helper column.
In column B I now have a helper column with the following formula:
In B1: =IF(A1<>"",A1,"")
In B2: =IF(A2<>"",B1&","&A2,"") drag this down.
In cell C1 I have this Formula: =IF(A1<>"",INDEX(A1:A10,COUNTA(A1:A10)),"") This will put the longest string of data into the cell.
In C2 then the original formula, wrapped with an IF to account for empty cells, can be inputted: =IF(A2<>"",A2&","&SUBSTITUTE($B$1,","&A2,""),"")
This are then the results:

Display value based on condition - Excel

I am trying to update one of the columns in the screenshot shown below based on a condition referring to counter column (Column F).
For example, if counter = 0, then column G should be blank, else it should take value from appointment column from the above cell.
Referring to the image below,
Cell G2 will be blank since counter = 0
Cell G3 should display value from B2 and H3 shall display C3
Cell G7 shall display should display value from cell B6 as they are all link to the same load (cell A6 has the load number)
Similarly cells G8 - G10 should also display value from B6.
Could anyone help me with the excel formula for the same. Thanks in advance.
Add "=IF($F2=0,"",IF($F2=1,B1,G1))" in G2 and Drag Down and Left.
Paste this formula in cell G2 and drag this down and across column G and H.
=IF($F2=0,"",B1)

How to update row value automatically in excel

How can I update the row values automatically in cell ?
Please see below image
If I change the value of "1" to "12" I want the down arrow cells to follow from it but increment by 1 like the image below
Write formula - =1 + A1 and drag it down to your limits.
change value 1 to any value, it will follow the increment as you want.
Assuming that the value 1 in your first image is cell A1, then yo7 can enter the followint formula into A2:
=A1 + 1
Then, copy this formula down the A column as far as you need. Now when you change the value of A1 to some other value, the whole column should update.

Setting a cell to a value of another cell IF another cell was value X

Is there a formula in excel to allow you to obtain the value of another cell WHEN a second cell was value X?
For example, something like:
=GETWHEN(A1,3,B2)
Which would return B2's cell value when A1 is value 3.
So if let's say you had a cell B2=4*B1. And B1 you set to 3, so B2 would show 12. But I want to make a row of entries to plot what B2 will be when A1 is 1, 2, 3, 4, 5 etc...
What could I put under A1 Values?
EDIT: I'm not looking for a if like in the conditional sense. I'm looking for the value WHEN (edited now)
You're thinking about data tables.
Provided you have your values in E2:E6, and your formula in B2:
Enter =B2 in cell F1.
Select E1:F6.
Go Data - Data table and put B1 into the Row input cell box (B1 being the cell on which B2 depends).

Resources