Excel drag-formula not working - excel

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

Related

Is there a way to add a formula to unique data points in excel?

I am trying to clean some data with this format:
A1 B1 C1
"0,1,0,E,1" "0,0,0,E" "0,1,1,1,2,E"
To obtain the information, I will need to sum up each cell individually, and then calculate the sum over a row.
So far, I have replaced all of the "E"s (for empty) with no data, which removed the E's, and I have replaced all of the commas with "+" signs to add the numbers in the cell. To run the formula of each cell, I will need to now place an "=" in front of each text string, however, if I copy it in with something like "="="&A1" the formula will not run because excel is reading the = as a letter or symbol and not an operator. Do you know of a way to fix this problem?
Thank you so much!
I think this will work for your version ...
=SUM(FILTERXML("<d><c>" & SUBSTITUTE(A1,",","</c><c>") & "</c></d>","//c"))
That's applied like below ...
... there's always someone smarter than me but that seems to work.
It’s not an in place replacement but it keeps your source data intact and provides a nice reconciliation point.
Using a separate sheet for each column of values, given data in cell A1 of
0,0,0,1,0,1,1,E,1,0
In C1, enter the formula
=IFERROR(MID(SUBSTITUTE(SUBSTITUTE($E$14,",",""),"E",""),COLUMN()-2,1)*1, "")
and drag the fill handle to to the right for as many cells as the longest number of data points you have.
Enter your SUM()formula in B1 (you can use the shortcut ALT + =).
Have you tried something like this, please refer the image, where its showing as per your required output, three alternative formulas
1.) Formula used in cell B2
=SUMPRODUCT(IFERROR(--MID($A2,ROW(INDIRECT("1:"&LEN($A2))),1),0))
2.) Formula used in cell D2
=SUMPRODUCT(IFERROR(--MID($C2,SEQUENCE(LEN($C2)),1),0))
The 2nd formula is applicable to Excel 2021 & O365 Users only
3.) Formula used in cell F2
=SUM(IFERROR(--MID($E2,ROW($1:$1000),1),0))
This is an array formula, so requires to press CTRL SHIFT ENTER !
Here is an update, the last formulas, which i have shared, shall work only when the digits are less than 10, however the present formula, shall work for all number of digits,
Formula used in cell B17
=SUMPRODUCT(IFERROR(--MID(SUBSTITUTE($A17,",",REPT(" ",100)),COLUMN(A1:Z1)*99-98,100),0))
Please adjust your range accordingly as per your data.

Excel formula to make cell read-only

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.

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.

Formula on Cell changes when I drag it down in excel

I have a formula which goes like the one below
=COUNTIF(D10:D1000,Q13)
But everytime I drag it down D10 becomes D11. All I want to change is Q13 to Q14 to Q15 and so on but not the D10. So the above formula is for Q13 and in Q14 I want the formula to be
=COUNTIF(D10:D1000,Q14)
And for Q15
=COUNTIF(D10:D1000,Q15)
Notice that D10 doesn't change but Q+value does.
Kindly advice, Thanks.
Lock the range. This can be done by adding dollar signs before the references (or pressing F4 after typing/selecting the range:
=COUNTIF($D$10:$D$1000,Q13)
Though in this situation locking the row should be enough, since you're dragging down, the D won't change (you can add the dollar signs where required, or press F4 repeatedly until you get the right lock):
=COUNTIF(D$10:D$1000,Q13)
If you want D10 to stay the same specify an absolute reference using $, like this:
=COUNTIF($D$10:D1000,Q13)

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