Formula in all cells in a column - excel

Simple question:
I want to create a formula which, in column Cn, will compute the values of An * Bn.
example
column C1 = column A1 * column B1
column C2 = column A2 * column B2
column C3 = column A3 * column B3
...etc
all the way down to
column Cn = column An * column Bn
Thanks

Easy way to do it.
Highlight your formula cell.
The lower right corner should turn into a + sign.
Click on that + sign and drag it for as many rows as you like.
Alternatively, you can do this:
Highlight the formula cell.
Ctrl+C to copy.
Click on the C column.
Hit enter.
Now with the second method, it may start to lock up on you because of the large number of cells it has to compute. Just hit escape and it'll go back to normal (but some cells may not be filled in, depending on how early you hit escape.)

In what context are you trying to create a formula? If in VBA, you can do something like:
Range("A1").FormulaR1C1 = "=RC[-2]*RC[-1]"
This formula is in R1C1 format. It tells the system to take the value two columns to the left of the cell containing the formula and multiply it by the column to immediately to the left of the cell containing the formula. This same formula could be entered in all rows of column C and would automatically adjust based on the row.

Related

Excel Formula to compare single cell value with the whole column and return the value for a particular row where match found

I need to compare the B2 Cell value (6012469) with Column A i.e. cell A2 to A10 and return the b2 cell value (6012469) in column C where the value matches i.e. cell C5,C7, C9 AND C10 and NA in remaining cells where the value is not matched.
I have around 15000 rows of data is column A and need to automate the process.
I have attached the sample image for reference.
[1]: https://i.stack.imgur.com/DvzC3.png
Select any cell inside your data range in Column A. Go to your ribbon, click Home > Format as Table. It doesn't matter what colour scheme you choose.
Make sure that all your data in Col A plus Cols B & C are included in the table.
Then, in any cell of your table in Col C (e.g. in C2), paste this formula:
=IF(ISNUMBER(SEARCH($B$2,[#[Column A]])),$B$2,"")
Excel should automatically populate all of your Col C in the table with this formula. (If it doesn't, then you should see a little clickable prompt next to the cell asking if you want to overwrite all the other Col C cells with this formula.)
The table with the Col C formulas would look something like this:
Note: Of course, you could achieve something very similar without using a structured table, but not as conveniently as this because you would have to copy the formulas down to the other approx. 15000 rows. Even the Fill Down feature is not as convenient.
ADDITIONAL: a different formula in response to the asker's request that each cell in Column C match any of multiple values in Column B --
=IFERROR(INDEX($B$2:$B$4,MATCH(TRUE,ISNUMBER(SEARCH($B$2:$B$4,A2)),0)),"")
NOTE: if more than one Column B value matches a Column A cell, Column C will display Column B's topmost match

Fill blank value in Excel

Need help in Excel for the following problem
ColA ColB
A1 B1
A2 B2
A3 B3
A4
A5 B5
A6 A6
A6
A6
if Column B is blank, I need to copy the value of ColA into ColB. But if the value is already present, then no action is needed.
Is it with formula or Vba?
A formula like should be ok (you copy/paste this formula to every cells in your Col)
=IF(B1="",A1,B1)
In column C enter the following formula:
=IF(B1="", A1, B1)
Copy this formula down column C. Then, assuming it looks right, you may delete the current column B, leaving the new column to become the new column B.
It is important to note that this formula won't work if directly entered into column B. In that case, Excel would complain about a circular reference.
Highlight the entire column B used range and press Ctrl+F to open find and replace then insert select
find " " (leave blank)
replace =OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),,-1,1)
Which looks like:
Result:
This, INDIRECT(ADDRESS(ROW(), COLUMN()), refers to the cell itelf, and -1 column offset argument refers to column to left.
You can then do copy paste as values to convert formulas to hard coded values.

How can an empty cell have formula?

Imagine a sheet like this:
A1 = 1
B1 = 1
C1 = A1+B1
It has about 20 rows, to make the it work on next rows I have to copy the C1 content and paste it on column C.
But I noticed that I don't need to do that, and every time I put data on A and B column, the column next to B, which is C, automatically sums them up.
For example: In Row 21, C21 is empty, but If I put data in A21 and B21, the C1 automatically sums them up without having any formula in it.
How's that possible?
If you have a repeating pattern, Excel tries to carry it on for you.
So, if you have headers in A1/B1/C2, numbers in A2:B20, and a formula in C2:C20 to add the values in columns A and B, then type a value in A21, hit [Tab], type a value in B21 and then hit Tab or Enter, the Column C formula will automatically be copied into cell C21.
Testing exactly that (Add headers, start in A2: value, Tab, Value, Tab, =RC[-2]+RC[-1], Enter, loop), Excel started autofilling in cell C6 (i.e. the 5th row of data)
its possible that you have the autoadd function activated on that cellAuto-sum Excel, which do that add without put any formula.

Identify minimum and maximum values based on 3 criteria

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

Excel logical statement

I want to accomplish a certain task in excel.
I want to practice 10 key skills.
I have typed numbers in column A(cells, A1,A2,A3,etc.). I want to retype them in column B. Then (if column B matches column A) would like to have the word "OK" appear in column c. Can write the simple IF statement for A1=B1. Do not know how to make the statement automatically apply to other cells(i.e if A2=B2, A3 =B3, etc).
Thanks. CD
In cell 'C1'
=If(A1=B1,"OK", "")
Now drag this cell down col C until your last row. Excel will auto increment A1 & B1 to A2 & B2 and so on... unless you use absolute referencing which is the dollar sign like this $A$1 for example.

Resources