I have sheet of data in excel. In column BF, when I select the BF1 to BF7 it shows there are 3 counts however, I failed to determine what that value is or why excel is counting a seemingly blank cell, BF3. I tried to change color of font of cell BF3, and I used 2 formulas to test it, still I can't figure out what the cell value is.
First formula I used =isblank(BF3) and second formula I used =value(BF3) and still no luck. Clearly the cell is not blank but what is it ?
Give this a try:
=IF(ISBLANK(BF3),"Truly empty",IF(LEN(BF3)=0,"Null value","Character code: " & CODE(BF3)))
where Null value means that BF3 contains something like:
=""
or its equivalent.
(An alternative:)
=IF(ISBLANK(BF3),"Truly empty",IF(LEN(BF3)=0,"Null value","Character code: " & UNICODE(BF3)))
If it is some weird Unicode character.
Related
I have an Excel spreadsheet with 7 cells (in a column) with data in, these are C13 to C19
I have a formula that combines all the data in these cells together and puts it into one cell, this formula is =C13&", "&C14&", "&C15&", "&C16&", "&C17&", "&C18&", "&C19 and works fine. However, can I alter this formula to miss out on any cell that contains the text "Nothing else carby"?
You may, in Excel 2019, use:
=TEXTJOIN(", ",,IF(C13:C19<>"Nothing else carby",C13:C19,""))
If "Nothing else carby" can be a substring inside a cell's value, try:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND("Nothing else carby",C13:C19)),"",C13:C19))
Confirm through CtrlShiftEnter
The formula should not be that long, as you can see:
=TEXTJOIN(",",TRUE,IF(C13:C19="Nothing","", C13:C19))
(I just used "Nothing" instead of the whole word for readability reasons.)
Explanation of the parameters:
"," : delimiter: between every cell content, a comma is added.
TRUE : treatment of blank cells (don't put them).
IF (...) : In case cell content is "Nothing", put an empty string.
In combination with the previous parameter,
just one comma will be put in the result:
"a,b,c,e,f,g" and not "a,b,c,,e,f,g" (see result).
Used data:
a
b
c
Nothing
e
f
g
Result:
a,b,c,e,f,g
SO I have a bunch of named cells in Excel (latest version) and I'm trying to use the following formula to reference them without copying zeroes :
=IF(named_cell,named_cell,"")
but I get #VALUE! However if I use
=named_cell
it works fine. Why isn't it working in the IF formula ????
It depends exactly what you want to test for:
=IF(OR(LEN(named)=0,named=0),"",named)
Tests for a single named cell containing zero or empty (but not a space character).
Use the names properly (make sure named_cell contains a Boolean):Cell A1 has the Name "ayeone" and the value TrueCell B1 has the Name "beeone" and the value BeeCell C1 has the formula: =IF(ayeone,beeone,""):
In VBA:
Sub WhatsInAName()
MsgBox Range("ayeone").Address & vbCrLf & Range("ayeone").Value
End Sub
If the named cells contain either text or are blank (no true numbers), zeroes returned from blank cells can be avoided by appending a zero-length string to the result.
=named_cell&""
This method can also be applied to VLOOKUP or INDEX/MATCH that would return zeroes from blank cells.
I have a formula that I want to use to check if a cell does not have an 'invalid' value in it. However, it is also counting empty cells, and cells that have anything in it that isn't equal to zero:
=COUNTIF(A2:A200,"<>0")
This only checks if the cell does not have a value of "0". What can I add to it so that it will not count empty cells, or cells with values like:
#######
VALUE?
r
etc. All I want is to count how many cells have a number in them that does not equal 0, or an error.
The array formula below first counts all non-0 and non-null values and then subtracts the count of cells that contain errors.
You need to press CTRL + SHIFT + ENTER to properly execute this formula:
=COUNTIFS(A2:A200,"<>0", A2:A200,"<>"&"", A2:A200,"<>"&"NIL") - SUM(IF(ISERROR(A2:A200),1,"")) - SUM(IF(ISNA(A2:A200),1,""))
You can nest up to 7 valid or invalid entries. If you need to have more than that you should perhaps designate a column for your "black list" of entries that you can add to when an occurrence causes a count that you don't believe should be valid. For example:
=IF(ISERR(VLOOKUP(A1,Sheet1!E:E,1,FALSE))=FALSE,1,0)
Where column "E" is your list of values that are considered invalid. Drag this down next to your criteria and sum.
Edit: I wasn't aware of countifs. So you have a couple of solutions, here, depending on your preference.
This formula will count only numbers <> 0, excluding blanks, error messages, etc. BUT it will not exclude the cells that display ###### (but really contain a number) if the reason for that is a column that is too narrow, or a negative date or time value.
=SUMPRODUCT(--ISNUMBER(A2:A200))-COUNTIF(A2:A200,0)
If you really want to avoid counting cells that display ####### when the underlying contents is a number not equal to zero, you will need to use a UDF to act on the Text property of the cell. In addition, narrowing or widening the column to produce that affect will not trigger a calculation event that would update the formula, so you need to somehow do that in order to ensure the formula results are correct.
That is why I added Application.Volatile to the code, but it is still possible to produce a situation where the result of the formula does not agree with the display in the range being checked, at least until the next calculation event takes place.
To enter this User Defined Function (UDF), alt-F11 opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this User Defined Function (UDF), enter a formula like
=CountNumbersNEZero(A2:A200)
in some cell.
Option Explicit
Function CountNumbersNEZero(rg As Range) As Long
Application.Volatile
Dim C As Range
Dim L As Double
For Each C In rg
If IsNumeric(C.Text) Then
If C.Text <> 0 Then L = L + 1
End If
Next C
CountNumbersNEZero = L
End Function
I'm trying to do a formula where it is CELL / 127.05 - 1 and apply this to columns H-Y and rows 2-455. I'm not really familiar with excel and am going about this calculation cell by cell. Also, I'm running into a "circular" problem where certain cells rely on another, if anyone could explain this.
Thanks ahead of time!
A formula in a cell generally cannot refer to itself. If you want to apply an operation to an existing range of data, you can, but it is quite rare and surely not in the spirit of a spreadsheet app.
Regarding your question, you could
- enter a value (127.05) anywhere in an empty cell,
- then copy that cell
- then select the range you want to modify
- then select Paste Special / Divide (or any other operation)
As I said above, it sounds like you want to apply that formula to same cell that contains the value you want to act on. That will not work. results cells (i.e. containing your conclusions) will contain the formula and a reference to the cell it will act on. (Although I am using a smaller area for illustration, the principles will apply to your specific application)
Note - I used the randbetween(min,max) function to populate all the data cells. this is why each image contains different data. You of course will use cells containing static data.
For a simple example:
Say you put the value 127.05 in cell A1, and have a range of data cells, like this:
In cell F1, enter = b1/$a$1 - 1 like this:
Note, the $ signs tell Excel to use a static location cell reference. After hitting enter, the value -0.85045 will appear. Now, click and hold your mouse starting in that cell, and drag your mouse down to row 14 release the mouse button and hit keys <ctrl><d>. Your sheet should look like this:
Hold down the shift key while the column is still selected, and hit the right arrow key 3 times, Your sheet should look like this:
release the shift key and while the cells are all highlighted, hit keys <ctrl><r>. The results are here:
One way is to highlight the column (or specific range) you want to apply the formula to, press F2 to access the formula bar, type the formula, and press CTRL+D to paste DOWN if the range is vertical and CTRL+R to paste ACROSS if the range is horizontal. Say that your data looks like this:
A B
--- ---
5 A1/127-1
4
7
8
Then in order to copy the formula down, highlight A2 to A4 and press CTRL+D, or highlight B1, and click on the bottom right of the box that comes up surrounding the cell.
If you wanted to simply replace the values in A with their formula values you would still have to use Column B as a 'helper' column, rather than entering the value right into the cell. This is in fact exactly what is giving you the circular reference error.
Regarding the circular error, you may be trying to apply the formula to the cell you are already in. For example, if you are trying to apply the formula A1 / 127 - 1 in the cell A1 Excel won't know what to do because you have specified that the value of A1 is both the value in the specified cell and another value ( A1 / 127 - 1), which can't be true.
Now, the only way I know of to do what you're requesting is with VBA, because I realized just now that I asked a very similar question a while ago which was helpfully answered by Gary. The code was as follows:
Sub Formulate()
Dim N As Long, i As Long, dq As String
N = Cells(Rows.Count, "A").End(xlUp).Row
dq = Chr(34)
For i = 1 To N
v = Cells(i, 1).Value
Cells(i, 1).Formula = "=Text(" & v & "," & dq & "mm/dd/yyyy" & dq & ")"
Next i
End Sub
I have formatted a cell in Excel as Scientific with 1 decimal place then I inserted a number in it like (0.41). After pressing enter the result displayed is (4.1E-01). My aim is to put this result in a cell with text format so that when I double click the cell, I can copy/modify the text (4.1E-01) as I want.
I tried to format that cell as text but the result gets back to 0.41. I also tried to copy the cell and paste the value only using "Special Paste" into a text-formatted cell but the result keeps returning to 0.41. Do you have a suggestion on how to solve this issue?
Thanks in advance
This is a bit of a work around unless you want to use VBA. In an adjacent cell type this formula:
=TEXT(A1,"0.00E+00")
Now you can copy that cell and paste values only and get just the text:
2.22E+27
If your okay with VBA use this:
Range("A2").Value = Range("A1").Text