I have number from 1 to 100 in column A1 to A100.
I am trying to achieve two results from data.
I want separately 1,2,3,4,5,6,7,8,9 and another one 10,20,30,40,50,60,70,80,90,100
Please help me
Maybe, in B1:
=1*(LEN(A1)=1)+2*(RIGHT(A1)="0")
double-click the fill handle and sort A:B on ColumnB.
This question is a bit vague. If you are looking to count by 10s, try adding a 10 in cell B1 and then adding the formula =B1+10 in cell B2. You can drag that formula down to count by 10s.
Let's say we want in column B "0, 1,2,3,4,5,6,7,8,9" and in column C "0, 10,20,30,40,50,60,70,80,90,100", put:
- =MOD(A1,10) as formula for the cell B1
- =INT(A1/10)*10 as formula for the cell C1
and then copy them to rest of the rows.
Related
I have a column that contains text cells and date cells. Next to each cell of text, I need the nearest cell that is above that text and contains a date to be returned.
Example
You can use INDEX/MATCH:
=IFERROR(INDEX($A$1:A1,MATCH(1,$A$1:A1,-1))/(ISTEXT(A1)),"")
You have to use a column agent (English is my second language so please give me a better way to describe it if you know), let's say column C.
Put this formula to C1:
=A1
Put this formula to C2 and fill down:
=IF(ISERROR(DATE(DAY(A2),MONTH(A2),YEAR(A2))), C1, A2)
The above formula check if A2 is a date then copy it or fill it down by the cell above.
Copy the cells you want in column B (B2:B4,...) from column C. Hide column C if you want.
Try below formula.
=IF(ISTEXT(A1),AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")),"")
If there are numbers also in cells rather that names then you can use below formula
=IF(LEFT(CELL("format",A1),1)="D","",AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")))
You can also use the LOOKUP function:
B1: =IF(ISNUMBER(A1),"",LOOKUP(2,1/($A$1:A1),$A$1:A1))
and fill down.
Suppose, in Cell A1 of Sheet2 I use this formula.
=AVERAGE(Sheet1!A1:A10)
Now when I drag down from A1 to A3
A2 will be =AVERAGE(Sheet1!A2:A11)
A3 will be =AVERAGE(Sheet1!A3:A12)
However I want it in a transpose way. Such as,
A2 will be =AVERAGE(Sheet1!B1:B10)
A3 will be =AVERAGE(Sheet1!C1:C10)
Means, I will use drag down rather than dragging to side, yet I'll get the answer in transpose way, more specifically, I want to change column index rather than changing row index by dragging a formula down.
Is there any way to do that?
Thanks in advance.
One way is to use this formula in Sheet2 A1 and copy down
=AVERAGE(OFFSET(Sheet1!$A$1,,ROW()-1,10))
As you drag it down, ROW()-1 increases by 1 and this is the column offset from A1.
In A1, ROW()-1 returns 0 so there is no offset, but as you go down this increases by 1 and this is the column offset from A1 - so in row 2 this becomes B1 etc.
The 10 indicates the size of the relevant range to be averaged.
In A1 enter:
=AVERAGE(INDEX(Sheet1!$A$1:$Z$10,1,ROW()):INDEX(Sheet1!$A$1:$Z$10,10,ROW()))
and copy downward.
If you need more than 26 items, increase the Z in the formula.
I want to add first "n" number of values of one column say B when the corresponding values of another column say C in same row equals to certain "text"
With data in B1 through C20
In D1 enter:
=IF(C1="text",1,"")
and in D2 enter:
=IF(AND(C2="text",COUNT($D$1:D1)<5),1,"")
and copy down. Then in another cell enter:
=SUMPRODUCT(D:D,B:B)
To do it as non-array formula I suggest something like this in D1:
=IF((C1="text")*(COUNTIF(C$1:C1,"text")=5),SUMIF(C$1:C1,"text",B$1:B1),"")
And copy down.
A different approach would be using an array formula like:
{=SUMIF(C1:INDEX(C1:C100,SMALL(IF(C1:C100="text",ROW(C1:C100)),5)),"text",B:B)}
Which will do the whole work in one step ;)
For single array formula:
=SUMPRODUCT((ROW($C$1:$C$20)<=AGGREGATE(15,6,ROW($C$1:$C$20)/($C$1:$C$20="text"),5))*($C$1:$C$20="text")*$B$1:$B$20)
I want to add 10 every 9th row in Column A. It should look like the image below. Can I get some quick help please.
Thanks in Advance
~T
Put this formula in cell A1 and fill down
=FLOOR.MATH(ROW()/9)*10+1
this version is more versatile:
=FLOOR.MATH((ROW()-5+1)/9)*10+3
5 is the starting row (so start the formula in the 5th row) and 3 is the startingnumber. Adjust these values as needed.
In A1 enter 1 and in A2 enter:
=IF(MOD(ROW(),8)-1=0,A1+10,A1)
and copy down:
This approach allows the ability to put the arbitrary starting value in A1 and the increment and repeat factor in the formula.
http://oi60.tinypic.com/30mvcli.jpg
So basically I want to check all values in column B against all values in column A. If there is a match I want column C to write the value of column in the corresponding row that A is on (as shown in the picture).
Not sure which forumla(s) I need to use to do this. Thanks.
Todd, I think a simple if statement should work here.
=IF(A1=B1,A1,"")
The above formula will copy the data from A1 into C1 only if A1 is equal to B1.
Enter this formula into C1 and drag it down for as many rows as you need (Excel will change the 1s to 2s etc). Let me know if this works for you :)
=IF(ISNUMBER(MATCH(A1, B:B, 0)), A1, "")
Put this to C1. Drag down for as many rows as you need.
In C1 try,
=if(countif(b:b, a1), a1, "")
Fill down as necessary.