Issue with Formulas not showing data after Row insert - excel-formula

Hi I have 2 sheets in Excel. One sheet, called DATA, has questions such as :"How did you find the room" with answers like "Excellent".
On the 2nd sheet I have a formula
=IF(Data!$I$4="Excellent ",5,IF(Data!$I$4="Good",4,0))
I have copied this formula to row 10.
If I add extra rows to the DATA sheet, the formulas in the 2nd sheet do not appear.

You are using absolute reference. Try removing the $. When the $ is present it prevents the row or column number from changing as the formula is copied. Place the cursor in a cell reference or select a range reference and press F4 repeatedly and it will cycle through the $A$1, A$1, $A1, A1 options.
Also note you have a space after "Excellent ". Matching for "Excellent" is not the same as "Excellent ". You may want to change your formula to:
=IF(Trim(Data!$I$4)="Excellent",5,IF(Trim(Data!$I$4)="Good",4,0))
Trim will remove excess spaces between words and only leave 1 space in between.
If you have more than just excellent in the cell and maybe something like "Excellent Job", you might want to use the SEARCH or FIND functions in your formula.

Related

Change part of excel formula with a constant value

I have an excel formula across a column for which the base changes every "x" number of rows. Note this "x" is not constant and keeps changing. e.g.
=D1/SUM(D$1:D$4)
=D2/SUM(D$1:D$4)
=D3/SUM(D$1:D$4)
=D4/SUM(D$1:D$4)
=D5/SUM(D$5:D$9)
=D6/SUM(D$5:D$9)
=D7/SUM(D$5:D$9)
=D8/SUM(D$5:D$9)
=D9/SUM(D$5:D$9)
I am trying to change the first part of the formulas without changing the second and vice versa. e.g. changing the numerator by 10 cells.
=D11/SUM(D$1:D$4)
=D12/SUM(D$1:D$4)
=D13/SUM(D$1:D$4)
=D14/SUM(D$1:D$4)
=D15/SUM(D$5:D$9)
=D16/SUM(D$5:D$9)
=D17/SUM(D$5:D$9)
=D18/SUM(D$5:D$9)
=D19/SUM(D$5:D$9)
or, changing the base by 100. e.g.
=D1/SUM(D$100:D$104)
=D2/SUM(D$100:D$104)
=D3/SUM(D$100:D$104)
=D4/SUM(D$100:D$104)
=D5/SUM(D$105:D$109)
=D6/SUM(D$105:D$109)
=D7/SUM(D$105:D$109)
=D8/SUM(D$105:D$109)
=D9/SUM(D$105:D$109)
Sometimes, both. Any guidance on how this can be possible?
Thank you.
the first part of this problem seems easy unless I am missing something?
Part 1:
Since the denominator is already in $x form, you can select and COPY the whole range of formulas and PASTE them 10 rows down and then CUT and paste it back into position. The COPY will update the numerators appropriately and when you CUT and PASTE it back into position they will now be just as you want? The second question will be a bit more of a challenge!
Part 2:
OK without VBA I can only think of a really long-winded way to change your demoninators, but I just checked that it does work:
To change the bottom.
Search and replace = with '=
Now you can edit the formulas more freely.
Search and replace D with D%
Search and replace D%$ with D
Search and replace D% with D$
get rid of the '= by using the Data>text to columns option
Now use the copy and paste, cut paste trick from part 1.
Then if you still need your $s back as they were you essentially repeat 1 to 5 again.
Sorry, this looks really long-winded, but if you are desperate and back up before you start it should work.
An excel formula can't replace another cells excel formula... One approach is to make the formula into text and then transform it by other formulas. When transformation is done, you could paste the formula back.
So for changing the D1 -> D11, I would build a dummy series (column K) then write a formula (cell L1). Then I can copy the formula and paste it into the correct column.
Replaceing the "=", with a special character and then you can transform the formulas.
(Column F).
In Column I, the formula used is: =RIGHT(F1,LEN(F1)-FIND("/",F1))
For changing D$1 -> D$100, I think I just would copy and replace it by searching in "Formulas".
This approach can be feasible for acouple of hundred cells. If the list is very long, I would recommend some VBA solution, where you can grab a cells formula with .Range("A1").Formula

How to Extract numbers from text to a column

I am new here and I have an Excel 2013 question.
How to extract numbers from one specific character to a column?
The strings are like: A10 B203 A22 K34 A60 A92 A81 A2 and
I would like to extract numbers after character A in one column
So, the result should be 10,22,60,92,81,2.
Max repetitions of A is 6. If is possible a Formula for this
If you want a formula to get rid of the first character and your list is in column A, enter this in B1:
=IF(LEFT(A1,1)="A",RIGHT(A1,LEN(A1)-1),"")
I'd suggest VBA, but since you have asked for a formula:
Apply Text to Columns with space as delimiter. If starting in A1 should populate A1:H1.
In J1 and copied across to Q1 (and down as desired):
=IF(LEFT(A1)="A",A1,"£")
(Use # or | or whatever suits if £ does not.)
Select ColumnsJ:Q Copy and Paste Special..., Values over the top.
Select ColumnsJ:Q and replace A by nothing, then £ by nothing.
Select ColumnsJ:Q and Go To Special..., Blanks click on one of those selected and Delete... with Shift cells left.
In S1 (copied down if required):
=LEFT(J1&","&K1&","&L1&","&M1&","&N1&","&O1&","&P1&","&Q1,
LEN(J1&","&K1&","&L1&","&M1&","&N1&","&O1&","&P1&","&Q1)-8+COUNT(J1:Q1))
(Beware of a line break if copying the above.)
(TEXTJOIN would be nice but is not available in all Excel versions.)
Should accommodate fewer than eight entries in a 'set' but would need adjustment for more than that.

Remove ' from cell, but keep cell content as text

I am looking to remove the ' before the content of a cell in order to do a VLookup, whowever when there are no letters it is turning the value into a number and the vlookup is retrieving inaccurate values. Any idea?
pre - '02364W105
post - 02364W105
pre - '151290889
post - 151290889 (this becomes 1.51E+08)
Change the cell format to Numbers and it does change the style. Normally it should work without it though.
You ha ve to select all these cells and change format to Number.
Probably they will still include the " ' " until you edit each one from the formula bar or pressing F2 and then ENTER.
The best way to avoid editing one by one is to write "1" into an empy cell, then copy it, then select all the cells you want to convert to number, then paste special, select "values" and "multiply".
This will convert all you cells with number formatted as text into numeric cells with numbers inside.

Excel Highlight one row based on another

I am trying to compare one row with another: IF the cells in Row 1 is equal to Row 2, THEN I must have highlighting. I've tried 100 methods for over an hour now. The problem is that Excel keeps the formula the same across the row!! the formula needs to change, meaning: I am NOT trying to highlight the whole row based on just the first cell, the cell needs to dynamically change. First cell to first cell, 2nd to 2nd, etc.
The circled words need to be highlighted.
Sorry to ensure everyone is clear on the requirement, here is my requirement:
The solution, as a brilliant guy below mentioned, was a stupid $ sign.
If you want the circled words to be highlighted, the "Applies To" field should be "=$A$10,$E$10" - to see what rules are being applied in those cells, they need to be part of the current selection or you need to change the selection in "Show Formatting Rules For" to "This Worksheet."
If you want the comparison to not be absolute, remove the dollar signs.
Also consider adding TRIM() around A9 and A10 in the formula if you don't want stray spaces to lead to a detection of a difference.
change the Formula to = A10 = A9 (or just remove the $'s in yours) and Applies To =$A$10:$E$10

Increment value inside curly brackets

I am using a formula in Excel 2010 to display the individual with the most wins, as below:
IF($P$3="Most wins",SUM(LARGE(Wins,{1})),"FALSE")
where wins represents an array of an indefinite number of individuals.
However I would like to be able to autofill this, or similar, such that the next row displays the following:
IF($P$3="Most wins",SUM(LARGE(Wins,{2})),"FALSE")
Unfortunately I can't get the value inside the curly brackets to increment, which is causing no end off issues when the formula is going to be dragged down beyond 1,000 rows.
Is this possible, or am I using the wrong method?
=IF($P$3="Most wins",SUM(LARGE(Wins,ROW(A1))),"FALSE")
Place that in the top of your column and copy it down. As you do, the cell reference for A1 will change from A1 to A2 to A3, etc. The ROW function returns the number of the row of the cell reference.
Alternatively as pointed out in Darren's comment, you could also use ROW()-2 if you data is starting in the second row. This has the advantage if you ver deleted the 1 row or column, you will not screw up your cell references.

Resources