Copy cell from a coloumn if value is starting with #excel #formula [duplicate] - excel

This question already has an answer here:
Fill non-contiguous blank cells with the value from the cell above the first blank
(1 answer)
Closed 7 years ago.
looking for some help...
the below is an example excel table. i have tried to work with alternatives... but none work for me... so again i came back to excel :(
i need : i am looking for a formula or a way to do the below job
i want to copy the cell starting with 0 in B to A
MY TABLE
A B C D E
1 0568695
2 956568
3 54649845
4 09447895
5 45649845
6 789454
7 546465465
8 0965445
9 456465465
10 454478
I NEED
A B C D E
1 0568695 0568695
2 956568
3 54649845
4 09447895 09447895
5 45649845
6 789454
7 546465465
8 0965445 0965445
9 456465465
10 454478
UPDATE :
is it possible to copy the value in A till next Empty cell
A B C D E
1 0568695 0568695
2 0568695 956568
3 0568695 54649845
4 09447895 09447895
5 09447895 45649845
6 09447895 789454
7 09447895 546465465
8 0965445 0965445
9 0965445 456465465
10 0965445 454478

You can use the formula:
=IF(LEFT(B2,1)="0",B2,A1)
And drag the formula down to the bottom.
Note: You will have to evaluate A1 manually.

Try this:
=IF(LEFT(B1, 1)="0",B1,"")
Hope this helps,
kpark.

Related

Deleting a row with VBA in Excel gives invalid reference in another table

I have an Excel Workbook with 2 sheets. Each sheet contains a formatted table.
The tables start at row2 and feature an internal numbering in columnA achieved by the formulas
=Row()-Row(talble1)+1 and =Row()-Row(talble2)+1
sheet2:
In table2/columnB I concatenate 2 of the internal row indices from table1 using the formulas
table2/internal row1: =CONCATENATE(sheet1!A2;";";sheet1!A3;";")
table2/internal row2: =CONCATENATE(sheet1!A4;";";sheet1!A5;";")
table2/internal row3: =CONCATENATE(sheet1!A6;";";sheet1!A7;";")
table2/internal row4: (...)
It looks like this:
sheet1/table1: sheet2/table2:
A B C A B C
1 1
2 1 2 1 1;2
3 2 3 2 3;4
4 3 4 3 5;6
5 4 5
6 5 6
7 6 7
8 8
9 9
If I "manually" delete the 2 rows with internal indices 3 and 4 in table1, the numbering automatically adjusts. Also, the references in internal row2/columnB of table2 become invalid, which makes total sense. The formula of internal row3 in table2 automatically adjusts to the deletion in table1 and remains valid.
It then looks like this:
sheet1/table1: sheet2/table2:
A B C A B C
1 1
2 1 2 1 1;2
3 2 3 2 invalid
4 3 4 3 3;4
5 4 5 4
6 6 5
7 7 6
8 8
9 9
Now comes the issue:
If I do the deletion described above using a VBA macro, the references in internal row3 of table2 become invalid as well! When I check the formula I see that it still references cells A6 and A7 which don't exist anymore in table1.
I used the code
sheet1.ListObjects("table1").DataBodyRange.Rows(4).Delete Shift:=xlUp
sheet1.ListObjects("table1").DataBodyRange.Rows(3).Delete Shift:=xlUp
It looks like this:
sheet1/table1: sheet2/table2:
A B C A B C
1 1
2 1 2 1 1;2
3 2 3 2 invalid
4 3 4 3 invalid
5 4 5 4
6 6 5
7 7 6
8 8
9 9
What is the explanation for the different behaviour of deleting a row in table1 manually or by VBA code?
I also recorded macros when deleting the rows manually and I could not detect anything that explains why my macro code leads to the invalid references in internal row3 of table2.

Excel: find row in a table by condition

I have two tables with same column names, but different data.
Table1:
A B C D
1 3 4 5 OK
2 6 7 8
3 9 8 7
Table2:
A B C D
1 9 8 7
2 1 2 8
3 3 4 5
I want to write formula in D of Table2, which would copy D-column values by row values from Table1. (I want to find same row in other table and set D-column value for it).
I could use SUMIFS(Table1!$D:$D, Table1!$A:$A, "="&A1, Table1!$B:$B, "="&B1, Table1!$C:$C, "="&C1), but all the rows are unique and I have string value in $D:$D - I don't need SUM exactly, I need only one string value.
Is there any function to find column value by row condition?
The result I want:
A B C D
1 9 8 7
2 1 2 8
3 3 4 5 OK

Excel: I want to remove duplicate values in same row and many columns

I want to delete duplicate values in same row and multiple column in excel... i want this
A B C D E F G H I J K RESULT
R1 8 0 1 8 1 5 8 1 9 5 5 80159
R2 7 8 7 7 4 5 0 7 6 8 9 78450689
R3 5 2 0 6 4 2 7 6 1 3 0 52064713
R4 4 3 5 0 7 2 5 3 2 4 8 4350728
If one has the Dynamic Array formula:
=CONCAT(UNIQUE(A1:K1,TRUE))
If not then the assumption is that 0 will never be in the first column and that the data is as you provided, one number per cell:
=MMULT(TRANSPOSE(MODE.MULT(IF(MATCH(A1:K1,A1:K1,0)=COLUMN(A1:K1),A1:K1*{1;1}))),TRANSPOSE(10^(COUNT(MODE.MULT(IF(MATCH(A1:K1,A1:K1,0)=COLUMN(A1:K1),A1:K1*{1;1})))-TRANSPOSE(ROW(INDEX($ZZ:$ZZ,1):INDEX($ZZ:$ZZ,COUNT(MODE.MULT(IF(MATCH(A1:K1,A1:K1,0)=COLUMN(A1:K1),A1:K1*{1;1})))))))))
Depending on ones version this may need to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
If it is text or the numbers are more than one digit then vba will probably be needed.

Formula to transpose horizontal numeric data vertical in excel

My input data in column A
1
2
3
4
5
6
7
8
9
If I want the above in Column B C D like
1 2 3
4 5 6
7 8 9
Use INDEX with some math:
=INDEX($A:$A,(ROW($A1)-1)*3+COLUMN(A$1))
Put in B1 copy over 3 columns and down 3 rows.
The *3 is the number of columns desired.

Sum Column that matches a given criteria in Excel

How would I sum vertically the columns that meet a given criteria?
For example:
A B C D E F G
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
If criteria = A, then the formula would give me 4
if B, 8
if C, 12. I would like the criteria input to be a reference-able cell.
Thanks for your help!
Use INDEX to return the correct array. Use MATCH to return the correct column:
=SUM(INDEX(2:5,0,MATCH(J1,1:1,0)))
Assuming you have a sheet like this:
=SUM(INDEX($BF$5:$BI$16,,Match($BC$5,$BF$4:$BI$4,0)))

Resources