Excel formula to make cell read-only - excel-formula

I'm trying to find a formula to make an Excel cell read-only based on criteria.
For example - if A2 is empty, make B2 and C2 read-only.
I haven't been able to find any examples of this. Can anyone help out?

That is not possible with a formula. Where would you want to put it? Not in A2 (here's the original data or empty), not in B2 or C2, here's where you might want to put new data.
You may put a warning symbol in a different cell, e.g. D2. Or, as suggested, you might want to use Data Validation on B2 and C2 to prevent them from receiving new input, if A2 is empty: Data Validation -> Custom -> Formula =NOT(ISEMPTY(A2)) and uncheck the "Igonre empty cells" option.
Anyway, this does not prevent you from eratsing B2 and C2 if A2 is empty. So for perfection, a VBA solution would be necessary.

Related

Excel formula to copy cell value without keeping reference to source cell

In my excel sheet, I need to copy the value of a cell A1 to another cell B1. When I change the value in cell A1, B1 should keep its original value.
Basically what would happen if you copy > paste special > Values
However, I cannot do this manually with mouse or keyboard input. I also cannot use macros/VBA.
Does a formula exist in excel that accomplishes this same task?
I tried playing around with =VALUE(A1) and =concat(A1) but these formulas all contain references to cell A1 and the result changes as soon the value in A1 changes.
As already mentioned in the comments, what you are asking can be done but at the cost of an error message and without the possibility of further calculations of the 'copied' cell, by letting the 'copying' cell refer to itself.
As shown in the screenshot above, the value returned in F3 is the value of E3 or itself, depending on the selection in F5.
Selecting "No" (or anything else but "Yes") in F5 and thereby having F3 refer to itself will show an error message, but the value it had will stay, even when saved and closed. However, no further calculation can be conducted on that cell:
Lastly, this solution is probably unstable.

Auto Copy and Paste Cell Values not Formula to another Cell

I also need to get your help for the same issue. I need to copy the cell values and not the formulas automatically to the other Cell, "automatically" meaning, I don't need to click, use mouse, or any other means to do that, like once theres a value on that specific cell (which is derived from a formula), the value will automatically be copied and pasted in the other cell (without any intervention from my part) (Only the value is copied not the formula)
Note:
The cell should contain only the copied value and not the formula.
Scenario:
A1 Cell : has 250 value
B1 Cell : has a vlookup formula to search for the value of A1 cell (I need to use VLOOKUP as there's a lot of items in the list, and it is "Dynamic", the reason I cannot just use formula "=A1" to get the value directly)
C1 Cell : Needs to copy and paste only the plain value from B1 cell which is 250, not including the vlookup formula, it should be automatically copied without any intervention (Cannot use VBA code / Macro as it will be run in excel online)
Thanks!!
Just use abasic Excel formula.
Example:
The source data is in cell A1.
You want to copy the same value to cell B1.
In cell B1 write:
=A1
That is all.
Additionally, you need to configure correctly the strategy for calculating the formulas:
I managed to find a solution, sharing as might help someone in the future, just needed to use =value(A1), instead of just "=A1", when I did this, the chart can read the values as it is and not the formula behind it. Found another work around as well, by using the formula =A1+0, for some reason this works too. –
=value(A1) works perfectly , If that formula contains a % figure , simple We can multiply by 100 to get the correct value.

Pull from List Excel

I have a set list that is frequently changed. Example shown below:
A1 AEZS
A2 AEMD
A3 EARS
A4 BCT
A5 BSTG
A6 CHFS
A7 BPMX
A8 ABCD
A9 ZERNA
A10 APPL
I want to extract from this list to pull the words that start with the letter "A", and make it into another list. From my research, I'm aware that using the following function.
Below is the end result I would like to do (C column is arbitrary):
C1 AEZS
C2 AEMD
C3 ABCD
C4 APPL
How can I do this?
I'm aware that using the formula =IF(LEFT("A",1)....etc is probably a good start. But I am new to Excel, and I am not too familiar to working with it. Additionally, I would like to be able to keep the cells in their each row (as in not all into one cell)
You can use an array formula (entered with CTRL+SHIFT+ENTER).
If your info (AEZS, AEMD, etc.) is in column A, starting row 1, you can put this in say B1 and drag down:
=INDEX($A$1:$A$10,SMALL(IF(LEFT($A$1:$A$10,1)="A",ROW($A$1:$A$10)-ROW(A$1)+1),ROWS(A$1:A1)))
Then, to hide errors, just wrap IFERROR([above formula],"") around it.
You can avoid using Array formulas by using the AGGREGATE function. It might also be handy to put the "starting letter" in a cell so it can be changed. For example, with your data in myRange in column A and the starting letters in the first row,
B2: =IFERROR(INDEX(myRange,AGGREGATE(15,6,1/1/(LEFT(myRange)= B$1)*ROW(myRange),ROWS($1:1))),"")
Select B2 and fill across as far as needed (eg to Bn)
Then select B2:Bn and fill down as far as needed.
To understand how this is working, I suggest you use Excel's built-in HELP feature, and also the formula evaluator tool.
And, of course, if this does not need to be dynamic, you can always use a simple or advanced filter. Again, these are well explained in HELP.
Advance Filter offers something of the capability, though is not dynamic:
Add a label to ColumnA and a criterion in A2:
="=A*"
Then DATA > Sort & Filter, Advanced and select Copy to another location, select ColumnA for List range:, A1:A2 for Criteria range: and Copy to: wherever suits.
Advance Filter remembers those settings (except, strangely, Copy to another location) so if the contents of ColumnA change it is only a few clicks to call up Advanced Filter again, select Copy ... and OK.

Excel drag-formula not working

I have a "subscription" column in column A. A1 is "12000". I want C1 to be "A1/12" AND D1 to be "A1/12". However, if I make the formula for C1 "A1/12" and then drag to the right, D1 will try to become "B1/12" which I DO NOT WANT.
I do not just want to make A1 a constant, because I want that when I copy and paste this onto the following rows, C2 and D2 should be "A2/12" and NOT "A1/12".
Thoughts? Sorry for the obfuscated explanation.
Just lock the cell. This is done with dollar signs, or when you put the reference, press F4.
=$A$1/12
And you can drag it without the formula changing the A1.
If you want it to change with changing rows, just lock the column A:
=$A1/12
Use the dollar sign to fix the reference:
=$A$1/12
You might want to have a look at this for more information
http://www.notjustnumbers.co.uk/2011/05/excel-tip-dollar-sign-in-formula-fixing.html

Multiplying all values in a column in Excel by a number

I want to multiply all the cells from B5 onwards by D2, and put the results from C5 onwards. How would I do this in Excel using a formula? Sorry if this is off topic, but this has been bugging me for a while.
Write a separate cell with say "5". Copy this cell.
Select the column to multiply and right click -> Paste Special -> Paste Special.
Under operations, choose multiply.
Note: You can also choose just a selection, if wanted.
So in your case:
Copy D2
Select B5 to your MAX
Paste Special -> Multiply
Should look correct
You could use your B data and change C to be a formula "=B5*$D$2".
Then drag that down and D2 should stay the same, while B5 becomes B6 and so on.
The results should be correct to your specification.
I hope this helped!
If I get 2 more rep--I can post you a picture of it.
To multiply using a formula, use the $D$2 reference to your multiplier to lock in the cell d2
This tip Emeria mentioned is exactly the way to do it. Keep in mind that you can set the $ on the Row (i.e. D$2) or the Column ($D2) or both ($D$2) and then when you drag using the little square in a selection down, the NON-$ range reference will increment, but the one with the $ will not.
google "locking a range reference excel"
hope this helps if so please vote me up I'm trying to get some points!

Resources