I've set cell A1 with data validation with list of possibilities: a,b,c,d
next I would need formula which will do this:
if a is chosen in A1 cell, set cell C1=b, C2=c, C3=d
if b is chosen in A1 cell, set cell C1=a, C2=c, C3=d
if c is chosen in A1 cell, set cell C1=a, C2=b, C3=d
if d is chosen in A1 cell, set cell C1=a, C2=b, C3=c
is there some handy formula for this purpose which I will place in cells C1, C2 and C3 which will backcheck with A1 and also between themselfs to avoid duplications?
google-spreadsheet
C1:
=FILTER({"a";"b";"c";"d"},{"a";"b";"c";"d"}<>A1)
The following array formula will do the job in Excel (select the range C1:C3 and use Ctrl+Shift+Enter to enter the formula):
=MID(REPLACE("abcd",MATCH(A1,{"a","b","c","d"},0),1,""),ROW(),1)
You haven't specified what you want the result to be if A1 contains neither of those values, but you may wish to wrap it in IFERROR().
Related
Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.
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.
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.
I am using this formula in cell B1 to get last value of visible cell
=LOOKUP(2;1/((SUBTOTAL(3;OFFSET(A2:A10;ROW(A2:A10)-MIN(ROW(A2:A10));0;1)))*(1-ISBLANK(A2:A10)));A2:A10)
It works well when cell from A1 to A10 doesn't contain a formula. The problem is that this formula not working when the cell contains a formula with an if statement.
For example, when in cell A10 I put the formula =IF(F1=1;1;""), the cell a10 shows blank because the condition is not true - and when I filter data the cell B1 show blank.
Replace:
1-ISBLANK(A2:A10)
with:
LEN(A2:A10)>0
Regards
I would use some different formula for that purpose. One option (array formula - Ctrl + Shift + Enter):
=INDIRECT("A"&MAX(IF(A2:A10="";0;ROW(A2:A10))))
another array formula option:
=INDEX(A2:A10;MAX(IF(A2:A10="";0;ROW(A2:A10)))-1)
Hi I have three columns in MS Excell. The columns are A1,B1,C1. C1 is calculated automatically based on formula. The formula defined for C1 is(=A1+B1). I mean C1 is the sum of A1 and B1. Now the problem is I wanted to copy the value of C1 to A1 and want to make the B1 column filled with 0.
The moment i try to copy C1 and paste it into A1 the A1 is displaying as "#href" something like this. so how do i copy the value of C1(without Formula) and then paste it to A1?
When you copy from C1 in A1 Excel is trying to insert in A1 the same formula contained in C1 with your relative addresses adapted to the new position, so the new formula in A1 should sum the two cells at the left of A1, but there are not cells at the left of A1, so the #href error is telling you that.
To do what you want you should paste it like "value". You find that option in the Paste command