Need help in excel formulas - excel

I have formulas for the top 4 rows formula is as follows row 1) C1= A1+B1 row 2 ) C2=A2+B2 row 3) C3=A3+B3 row 4) C4=C3/C1 and the next row is blank ie C5 post which the same continues 4 rows has formula and the 5th row is blank I have a huge data how to copy the formula below please help
Am struck please someone assist
I have skipped the blanks and copied the first four rows selected the below rows and pasted I need any other alternative either by formula or by copy paste

Cell C1
= IFS(MOD(ROW(),5)=0, "", MOD(ROW(),5)=4, OFFSET(C1, -1, 0)/OFFSET(C1, -3, 0), TRUE, A1+B1)
You can calculate all your data using that formula simply. Just double-click or drag the fill handle of cell C1 down to copy the formula.

The easiest way to do this on a very large scale is to just have ONE and ONLY one formula that applies to all cells, so you are copying it all the way down the sheet one time.
I'd do this by looking at ROW() to get the row number, and more specifically, using MOD(ROW(),5) to get a row index that goes 0-4, with 0 being the blank row.
This formula will look back up to previous rows so you will have to "prime the pump" for the first 3 rows manually:
Cell C1 will be =A1+B1
Cell C2 will be =A2+B2
Cell C3 will be =A3+B3
Cell C4 will be =SWITCH(MOD(ROW(),5),1,A4+B4,2,A4+B4,3,A4+B4,4,C3/C1,0,"")
Then copy this cell, C4, down the entire length of the sheet.
My specific formula assumes there's no headers and the values start in row 1.
If not, you just have to move the formulas to the right SWITCH indexes 0-4.

Related

Using VLOOKUP to match 2 cells sheet2 to sheet1 and return the 3rd cell

I have been using VLOOKUP() to populate worksheets with Inventories, however I'm stuck with an issue where one column has the same value in multiple cells, I need to match 2 cells from sheet 2 with sheet 1 and have it return the 3rd cell from sheet 1 into sheet 2.
I'm working with about 350 rows in both sheets, and in some cells the same/different values repeat it self hence needing it to match with 2 cells in the same row.
This is the formula I currently use:
=VLOOKUP(A1&L1,'Sheet1'!$A$1:$E$351,3,FALSE)
I'm expecting it to return the value that's in the 3rd column on sheet 1 in the row that matched the values of Cell A1 and L1 in sheet 2. and the same going on A2 & L2 then A3 & L3 and so forth.
Unless you have values in Column A of your 'Sheet1' that are the equal to to concatenation of your values in Columns A and L in 'Sheet2', the formula will not work.
Instead, I'd try FILTER if you have the newest version of Excel. Something like:
=FILTER('Sheet1'!$C$1:$C$351,
(('Sheet1'!$A$1:$A$351=A1)*('Sheet1'!$L$1:$L$351=L1)))
Another option is INDEX. Something like:
=INDEX('Sheet1'!$C$1:$C$351,
MATCH(A1&L1, 'Sheet1'!$A$1:$A$351&'Sheet1'!$L$1:$L$351,0),
3)
The only way to do this task is to use a helper column
Go to Sheet one where the data table is, insert a column at the starting point of data e.g your Data set starting in SHEET1 from the column A. so insert new column in A
use this formula in A1
=CONCATENATE(B1,C1,D1,E1,F1) Press Enter, Drag the formula down to A351
now go to sheet2 and use this formula in the result cell
=VLOOKUP(A1&L1,'Sheet1'!$A$1:$F$351,4,0)

How do we change column value and keep row constant in spreadsheet formula?

I have to calculate the value of cells A1 till A10 and it takes values from M21, N21, O21, and so on till V21.
How can I write a formula to calculate the same?.
I tried =M$21 to keep row 21 constant, but while dragging the formula down from A1 till A10, it doesn't change the column ref as it's dragging down.
How can I change the column reference to change while dragging the formula down from A1 till A10?.
I would index across the columns based on the current row:
=INDEX($M$21:$V$21,ROW())
use in google sheets:
=INDIRECT(ADDRESS(21, ROW(A13))
dragging this down will give you N21, O21, P21, etc.

Auto increment column value by 3 columns in copying across a row

I have an Excel 2 worksheet workbook - 'Dairy' and 'Production'
Formula in 'Production' E10 is 'Dairy'!I33
I want the Formula in 'Production' E11 to be 'Dairy'!L33 (an increment of 3 columns, but same row.)
I cannot use Alt EIR, because it only increments the cell value (I33) by one column (to J33).
What formula can I use to increase the I33 by 3 columns to L33, then in the next cell/E11 increase the L33 to O33, and so on?
EXAMPLE -
Production cell number E10 E11 E12 E13
Production cell value D!I33 D!L33 D!O33 D!R33
thank you,
Mike
INDEX typically uses less calculation cycles than OFFSET and this benefit increases the more formulas you have.
=INDEX(Dairy!33:33, 1, (COLUMN(A:A)-1)*3+9)
Put that under E10 and drag right (and down if needed).
If E10 is actually the cell you want the formula and you are going to drag it down then use this in E10 and drag down.
=INDEX(Dairy!$33:$33, 1, (ROW(1:1)-1)*3+9)
You can use Offset formula which returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and the number of columns to be returned.
Syntax:
=OFFSET(reference, rows, cols, [height], [width])
Solution:
Cell E10 Formula : =OFFSET(Dairy!I$33,0,0,1,1)
Cell E11 Formula : =OFFSET(Dairy!I$33,0,3,1,1)
Cell E12 Formula : =OFFSET(Dairy!I$33,0,6,1,1)
and so on....
To make it completely dynamic, link the third argument to the current row. For e.g.
Cell E10 Formula : =OFFSET(Dairy!I$33,0,MOD(ROW(A10),10)*3,1,1)

How to Autofill cells up to a certain row based on the value in a different cell?

So I have a cell (let's say C3) and I have a column in A.
Let's say that the formula I want to fill for the cells in columnA is A2 = A1 + 1 and so forth.
I have the number 30 in C3.
I want excel to fill exactly 30 cells down column A using that previous formula (A2 = A1 + 1).
If I change the number in C3 to 50, then excel will automatically add 20 more rows in column A following the same pattern.
If I change the number in C3 to 10, excel will automatically delete the rows until the first 10 rows remain.
EDIT TO ADD: OK so I guess I have to use macros. Anyone suggest the VBA code for this?
You can avoid VBA if you know a maximum possible number of rows. Use the following formula in A2 and apply it downward until you've applied through the maximum number of columns.
=IF(ROW()<=$C$3,A1+1,"")
So in reality, you still have a formula in these cells, but you won't see any output until they are supposed to be seen. It's a work-around.

I have a column in Excel which gets data from another column, in another spreadsheet. How do I add an empty row after every cell?

As the title suggests, I have a column in my first worksheet which gets its data from another column, in a second spreadsheet.
I have linked them using ='Data'!B1
Of course, if I drag the handle down, I get all the remaining data from the linked column, but I would like to have an empty row after each cell.
Like so: B1 has data, B2 is blank, B3 has data, B4 is blank, etc.
If some kind person out there could help me out, I would appreciate it very much. I have tried macros and looked this up in forums but can't seem to make this work with Data --> Sort.
Thank you! :)
Given what you're asking for, the way I would do it would be using the Offset or Indirect function so I can control which cells to pull in from the other sheet.
Given your example, in Sheet1, I would have:
B1: =OFFSET(Sheet2!$B$1,(ROW(B1)-1)/2,0)
B2: <blank>
B3: =OFFSET(Sheet2!$B$1,(ROW(B3)-1)/2,0)
B4: <blank>
You can drag this down and it will give you alternating formula / blanks and pull the consecutive row from the other sheet.
As a quick explation, the function will always look at cell B1 in your second sheet and offset it by (Row()-1)/2 rows... So, in row 1, it would offset it by (1-1)/2 = 0 rows, in row 3, it would offset it by (3-1)/2 = 1 rows, etc.
Hope this makes sense and does the trick!!

Resources