If Cell is blank, reference the left cell - excel

Image for reference:
If the cell on the right (B1) is blank, I want it to use the data in the left cell (A1).
I have tried:
=IF(ISBLANK(B1), A1, B1)
However, this only results in an error.
=IF(ISBLANK(B1), A1, "")
This results in a 0.

Without VBA: Circular reference problem.
If you want to check that if B column has data then no need to paste the column A data..And if column b is blank then you want the column A data to paste in column B , right?
If that's the scenario then you need to open iterative analysis..For this
Go to File>Options>Formula>Enable iterative analysis.

Try this:
=IF(OR(ISBLANK(B1), B1=""), A1, B1)

Related

Lock excel reference to a single cell on another sheet / workbook even after moving the source

I want the formulas in Sheet02 to remain intact even after moving or deleting the cell data in Sheet01. The formulas in Sheet02 should always show what is in Sheet01 A1, A1, B1, B2, etc. When I move the cell A1 to C1, the formula in Sheet02 automatically turns to =Sheet01!C1 and I want it to remain at =Sheet01!A1.
Sheet01
A
B
A1
B1
A2
B2
Sheet02
A
B
=Sheet01!A1
=Sheet01!B1
=Sheet01!A2
=Sheet01!B2
I have tried with VLOOKUP, but same result. Help apreciated.
I dont know if this is best solution but it works:
Write your formula as =INDIRECT("Sheet01!A1") it will not change whatever happens in Sheet01 but problem is you cant Copy/Fill this formula and each formula has to be writen separatly,
But if you want to return cells in same position but from Sheet01 you can adjust it like this: =INDIRECT("Sheet01!"&ADDRESS(ROW(),COLUMN(),4,1))
Hope it will help.

Find the Last Cell Value of the 2nd Column Set for each 1st Column Cell in EXCEL

I have the following structured table in excel where 1000s of rows included.
I want to return the Last Cell Value of Column B for Each value in Column A.
For example:
For Cell A1 -> I want to return the Cell B5.
For Cell A6 -> I want to return the Cell B9.
I have tried with VLOOKUP, HLOOKUP, INDEX likewise so many formulas where I ended with more conflict situations. Can anyone please write down a Formula to give my requirement a life?
Array formula (Press Control + Shift + Enter while entering the formula) in cell C1 and copy it down.
=IF(A1="","",IFERROR(INDEX($A2:$B$20,MATCH(FALSE,ISBLANK($A2:$A$20),0)-1,2),LOOKUP(2,1/(B2:$B$20),B2:$B$20)))
if you don't mind using column C as a helper column you could use something like that:
If you won't use Array formula you can Use this solution:
like this image:
use column C as helper with this formula in first cell =OFFSET(A1;SUMPRODUCT(MAX(($A$1:$A1<>"")*(ROW($A$1:$A1))))-ROW(A1);0)
and use this formula in column D's first cell =IF(A1="";"";INDEX($B$1:$B$13;SUMPRODUCT(MAX((ROW($A$1:$A$13))*($C$1:$C$13=A1)))))
and copy fill-down to all cells.
Try this shorter, without helper column and non-array formula solution
In C1, formula copied down :
=IF(A1="","",INDEX(B1:B$9,MATCH(1,FREQUENCY(1,0+(A2:A$9<>"")),0)))

Insert a value to a cell in excel using formula in another cell

I need to insert a value to a cell in excel using formula in another cell.
Say
A1 = "Test"
B1 = formula to insert A1 to C1
C1 = A1
Can I write a formula in B1 to insert value in C1?
I don't need any formulas in C1.
If Yes, What should be the formula?
If there it is next to the cell AND has no value in B2, it is possible, otherwise it is not.
Use Split()
Split(CONCATENATE("Text for B1#Sperator$$",A1),"#Sperator$$",FALSE)
It really depends.
EDIT
Out dated. Only works in google sheets.
Without using VBA or formulas in column C you can't achieve this.
A simple solution using formulas:
In cell C1, paste the following formula and drag it down:
=IF(B1=1;A1;"")
So if the content of cell B1 is equal to 1, your cell at column C will display the respective value of the same row at column A.

Excel formula for finding a column match and writing to that specific adjacent row

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.

Excel : Increment Row number on fill right

When one "Fills right in excel" , the Column name updates
eg.
1st cell
is
=A2
If I fill right the next cell will be =B2
But rather than the column incrementing I want to increment the row number
so 1st cell is
=A2
The cell on its right is
=A3
how do i do that?
If you're putting the first formula in B2 then
=OFFSET($A$2,COLUMN()-2,0)
The -2 part is because we're starting in column B. You need to change it for whatever column you're actually starting in such that the second argument equal zero.
You can do this using the INDIRECT function. Suppose we want formulas in cells B1, C1, D1... that should reference A2, A3, A4... Starting in cell B2 we can enter:
=INDIRECT("R[" & COLUMN(RC)-1 & "]C1", FALSE)
In cell B2, this will render as:
=INDIRECT("R[1]C1", FALSE)
In this situation, I'm using R1C1 format. The second parameter to the INDIRECT function tells the function to use R1C1 format. The function itself (again in cell B2), says "give me what is in the cell that is one row down and the first column". In the original formula, by basing the row value on the current column number, it will update the formula to a new row as you fill right.
Now, if you are asking if there is a way to do this using the GUI like say using the Fill box with the mouse, the answer is no. There is no means to transpose the fill using the GUI.

Resources