How to create data sequence with excel formula? [closed] - excel

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 8 years ago.
Improve this question
what i need is formula to create data in column B based on column A
if data in column A = 1 then column B is 1, if A=2 B still 1
If data in A=1 again B is 2
A B
1 1
2 1
3 1
1 2
2 2
1 3
1 4
2 4
what formula to create value in column B

You could perhaps try the following formula in column B row 3, assuming that there are no headers in A and B:
=IF(A2>A1, B1, B1+1)
And drag it down (or copy/paste it). But you will have to put the first number in the first cell B1.
| A B
--+--------------
1 | 1 1 => 1
2 | 2 1 => =IF(A2>A1, B1, B1+1)
3 | 3 1 => =IF(A3>A2, B2, B2+1)
4 | 1 2 .
5 | 2 2 .
6 | 1 3 .
7 | 1 4
8 | 2 4

Related

How to convert two rows of data into a single row using Excel macros [closed]

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 hours ago.
Improve this question
My original data
ID
Name
m1
m2
m3
1
X
2
6
6
1
Y
1
2
3
2
A
2
4
7
2
y
5
6
7
To be converted to below format using Excel macros
ID
Name1
m1
m2
m3
Name2
m1
m2
m3
1
X
2
6
6
Y
1
2
3
2
A
2
4
7
y
6
6
7

Return the max value in a new column for each repeating value in the other column [duplicate]

This question already has answers here:
How to assign a name to the size() column?
(5 answers)
Closed 11 months ago.
Background: I was hoping to generate a new column named: datasample based on another column named: end_bin from a table.
Question: Is there a way to return the max value in each row of the new column if the value is repeated in the previous column.
Expected result:
end_bin
datasample
6
1
8
1
10
1
2
3
3
1
2
3
2
3
I couldnt find a method to do this in pandas, any help is appreciated:)
Your question is unclear, but it looks like you want the size per group:
df['datasample'] = df.groupby('end_bin')['end_bin'].transform('size')
Output:
end_bin datasample
0 6 1
1 8 1
2 10 1
3 2 3
4 3 1
5 2 3
6 2 3

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

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)))

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

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.

Resources