Excel 2011 cannot execute a function in cell - excel

I am using MAC 2011 Excel (version 14.4.2)
When I input a function =IF(B5=B6,B5, " ")
but when i press enter, instead of giving me the result, the cell show
=IF(B5=B6,B5, " ")
What am I mising?

If you mean that your cells are showing formulas instead of the values produced by the formulas you can find an option in the Formulas tab to turn this off/on. I'm on PC where is looks like the following:
Obviously it will differ slightly on a Mac OS.

When I usually see this, the cell is formatted as Text.
Clear all formats from the cell
Force Excel to look at cell contents again by either
a. Find-Replacing all "=" with "=" or
b. Entering cell editing and immediately leaving
source

Related

How to extract & add all the nos. from brackets in excel when there are such multiple instances

I am stuck with a data in excel having the above form and wish to add all the numbers between brackets and finally give its addition after applying the formula.
For ex. abc(200), def(300), gijklmno(5000), pqrstuvwx yz(50000) should give 55500 in another cell
Trying: abc(200), def(300), gijklmno(5000), pqrstuvwx yz(50000)
Expecting: 55500
Alternative:
=SUM(0+INDEX(TEXTSPLIT(A1,"(",")",,,0),,2))
In case you don't have the newest functions, you could use something like:
=SUMPRODUCT(FILTERXML("<a><b>"&SUBSTITUTE(SUBSTITUTE(A1,")","("),"(","</b><b>")&"</b></a>","//b[number()=.]"))
which should work in 2013 or later, I think.
You can try using a formula like shown below,
• Formula used in cell B1
=SUM(--BYCOL(TEXTSPLIT(A1,","),LAMBDA(x,TEXTBEFORE(TEXTAFTER(x,"("),")"))))
Alternative approach since you have not mentioned your Excel Version, the below formula works with Excel Windows 2010+ & MAC
• Formula used in cell B1
=SUMPRODUCT(IFERROR(--TRIM(MID(
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"(",")"),")",","),",",REPT(" ",100)),
COLUMN($A$1:$Z$1)*100-99,99)),0))
Note: Depending on one's Excel version this needs to be keyed with CTRL+SHIFT+ENTER instead of Enter when exiting edit mode.

Excel SUM function is not working (shows 0), but using Addition (+) works

I'm stumped in Excel (version 16.0, Office 365). I have some cells that are formatted as Number, all with values > 0, but when I use the standard SUM() on them, it always shows a result of 0.0 instead of the correct sum. When I use + instead, the sum shows correctly.
For example:
SUM(A1:A2) shows 0.0
A1 + A2 shows 43.2
I don't see any errors or little arrows on any of the cells.
Excel is telling you (in an obscure fashion) that the values in A1 and A2 are Text.
The SUM() function ignores text values and returns zero. A direct addition formula converts each value from text to number before adding them up.
Using NUMBERVALUE() on each cell fixed it. Even though each cell was formatted as a Number, since the data was originally extracted from text, the cell contents apparently were NOT being treated as a Number. Yet another flaw in Excel.
I get a similar issue while importing from a csv.
Selecting the cell range and formatting as number did not help
Selected the cell range then under:
Data -> Data Tools -> Text to Columns -> next -> next -> finish
did the job and numbers are now turned into numbers that excel consider as numbers !
This avoids use of NUMBERVALUE()
There is a much faster way you just need to replace all the commas by points.
Do control-F, go to "Replace" tab, in "Find what" put "," and in "Replace with" field put "."
I noticed that if the sum contains formulas if you have any issue with circular references they won't work, go to Formulas-->Error checking-->Circular References and fix them
If there's a tab in your .csv then Excel will interpret it as text rather than as white space. A number next to a tab will then be seen as text and not as a number. Convert your tabs to spaces with a text editor before letting Excel at it.

Trying to display the literal value of a concatenated cell in another cell

I'm having trouble phrasing my question, so here's a screenshot. Basically I want G2 to be a field I can copy and paste into a field on a website for billing purposes. The TEXTJOIN function is the closest I've gotten to making this work but it still isn't right. I'm having the following problems:
The price of each fruit loses its ending 0's during concatenation
I intend to keep adding more fruits, but =TEXTJOIN(E:E) includes E1 which is obviously the heading
The resulting string in G2 isn't copy-and-paste-able without first copying and selecting Paste Value within Excel
Screenshot for reference:
I might not be able to avoid the last problem without VBA but I'd like to at least navigate around the first 2 issues. I suppose creating a button that would output G2's value to a Notepad document would work as well, or something along those lines.
In E2 put:
=A2&"("&TEXT(D2,"$#,##0.00")&")"
to do the concatenation.
Then just specify the start in E2:
=TEXTJOIN(", ",TRUE,E2:E1040000)
Also you can skip the helper columns with the following array version of TEXTJOIN:
=TEXTJOIN(", ",TRUE,$A$2:INDEX(A:A,MATCH("zzz",A:A))&"("&TEXT($D$2:INDEX(D:D,MATCH("zzz",A:A)),"$#,##0.00")&")")
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
When you copy a cell to the clipboard and paste it anywhere but Excel it should only paste the text, but that may depend on the website also.

MS Excel showing the formula in a cell instead of the resulting value

The above image shows 3 cells containing the formula instead of the value; The first cell is under PHP Hourly Rate, the second is under Name and the third is the Invoice Sub Total. However, the values will show after I double click the cell then press enter. Why is this happening? I am using Excel VBA on Excel 2013.
Thanks.
Make sure that...
There's an = sign before the formula
There's no white space before the = sign
There are no quotes around the formula (must be =A1, instead of "=A1")
You're not in formula view (hit Ctrl + ` to switch between modes)
The cell format is set to General instead of Text
If simply changing the format doesn't work, hit F2, Enter
Undoing actions (CTRL+Z) back until the value shows again and then simply redoing all those actions with CTRL-Y also worked for some users
If you are using Excel 2013 Than do the following
File > Option > Advanced >
Under Display options for this worksheet: uncheck the checkbox before
Show formulas in cells instead of their calculated results
This should resolve the issue.
If all else fails, Ctrl-H (search and replace) with "=" in both boxes (in other words, search on = and replace it with the same =). Seems to do the trick.
I had the same problem and solved with below:
Range("A").Formula = Trim(CStr("the formula"))
If you are using VBA to enter formulas, it is possible to accidentally enter them incompletely:
Sub AlmostAFormula()
With Range("A1")
.Clear
.NumberFormat = "#"
.Value = "=B1+C1"
.NumberFormat = "General"
End With
End Sub
A1 will appear to have a formula, but it is only text until you double-click the cell and touch Enter .
Make sure you have no bugs like this in your code.
Try this if the above solution aren't working, worked for me
Cut the whole contents in the worksheet using "Ctrl + A" followed by "Ctrl + X" and paste it to a new sheet. Your reference to formulas will remain intact when you cut paste.
Check for spaces in your formula before the "=". example' =A1' instean '=A1'
I tried everything I could find but nothing worked. Then I highlighted the formula column and right-clicked and selected 'clear contents'. That worked! Now I see the results, not the formula.

Getting formula of another cell in target cell

How does one cell obtain the formula of another cell as text without using VBA? I can see this question has already been asked many times and the answer is always to write a custom function in VBA.
However, I found a post made in 2006 which claimed to have found the non-VBA solution but the link provided in that post is already broken.
=FormulaText(Reference) will do the trick Documentation
There is nice way of doing this without VBA. It uses XL4 macros (these are macros, but it is not VBA, as asked).
With reference to the figure 1, cells A2:A4 contain usual formulas.
Going to Formulas -> Define Name, I defined two named ranges (see fig. 2), with the information shown in cells A6:B8.
Enter in cell B2 =FormulaAsText. This will retrieve the formula in cell A2 as text.
Explanation:
The named range FormulaAsText uses =GET.CELL(info_type,reference). In this case, ìnfo_type = 6 retrieves the formula, and reference = OFFSET(INDIRECT("RC",FALSE),0,-1) uses the cell with 0 rows and -1 columns offset from the one the formula is used in.
Copy B2 and paste into B3:B4. This will show formulas in A3:A4. Cell A4 shows that the worksheet function CELL only retrieves values, not formulas (as opposed to GET.CELL).
Since FormulaAsText gets the formula from a cell at fixed offset (0,-1) from the current, I defined another range FormulaAsText2, which uses an offset (rows,cols) read from the worksheet itself. Cells D2:D4 contain =FormulaAsText2. Thus, cell D2 shows the contents of cell B3 (=OffSET(D2,1,-2)), which is FormulaAsText. cells D3:D4 show the contents of themselves. This adds some flexibility. YMMV.
PS1: The essence was taken from
http://www.mrexcel.com/forum/excel-questions/20611-info-only-get-cell-arguments.html
PS2: Tim Williams mentioned in a comment "the old XLM GET.FORMULA()". This answer is possibly related (not the same, since this one uses GET.CELL()).
PS3: A simple VBA solution is given, e.g., in
http://dmcritchie.mvps.org/excel/formula.htm
EDIT: Complementing this nice answer, the worksheet function FormulaText is available for Excel 2013 and later.
This suggestion may be helpful for those who after retrieving a block of formulas and transporting them to a new spreadsheet want to put them to work again. Excels FORMULATEXT function is great for picking up formulas but it leaves them as unusable text strings. If you want to get them back as fully functioning formulas you have to edit each one individually to remove the string character, but here is a shortcut for larger blocks.
Get to the position where you have the required formulas as text (in other words after using FORMULATEXT - you have done a copy and (value only) paste). The next step involves highlighting all the cells you want to convert and then navigating to the [Text-To-Columns] menu option ({Data} bar on Excel 2016). You can select 'Delimited' but on the next screen just make sure you de-select any marks that do appear in your formulas. Then 'Finish'. Excel should automatically analyse the cells as containing formulas and you should now have them working again.
There is a way to do this. In my example I had a table that showed a date. The date comes from Sheet!G91. In my table I also had a column that showed the sheet name. I added two more columns to my table. The first column had column(Sheet!g91), which returns the number 7, because G is the seventh letter in the alphabet. I then converted the number to a letter (G) using another table in my workbook. In the second column that I added, I made a formula row(Sheet!G91), which returns the number 91. Note: Row and Column may appear as volatile formulas, which recalculate with every calculation of the workbook.
I wanted another column to show the formula contents of the date cell mentioned at the beginning of this post. I included the following string function (you can also use CONCATENATE).
"=" & AJ9 & "!" & AM9 & AN9
The items separated by ampersands get strung together (that is, concatenated). AJ9 in my example contains the sheet name, AM9 contains the column letter, and AN9 contains the row number.
I now have a column that dynamically updates its contents to reflect the sheet name and cell reference. The results in my workbook cell are
=Sheet!G91.
You can't. This is most likely a design choice to eliminate an average Excel user from accidentally getting something they did not want.
What you are reading is correct - writing a UDF is the solution you want.

Resources