Excel =Column() giving #NAME? error - excel

=COLUMN()
This was working fine yesterday but today it gives me #NAME? as the result rather than the column that the formula is in.
What is going on today that's different from yesterday?
Edit: Even more bizarrely if I enter the =COLUMN() using the fx (insert function) button then it works fine.

Thank you for copying over the formula from your Excel here. Otherwise I never would have found it.
The problem is that you have some non-standard characters in your formula which do not show. Doing a 1:1 comparison of your formula with a formula I have written myself into Excel using AscW() I came up with the following result:
Character Letter AscW(yours) AscW(mine)
1 = 61 61
2 C 67 67
3 ? 8204 79
4 ? 8203 76
5 O 79 85
6 L 76 77
7 U 85 78
8 M 77 40
9 N 78 41
10 ( 40
11 ) 41
As you can see, your formula is by two letters longer. There is a AscW(8204) and a AscW(8203) between the C and the O of the word Column. These characters do not show. Yet, they are there.
Also note, that this is not the case everywhere in the Column() you have posted in the above question. The first =COLUMN() at the top of your post is fine and works normally. Furthermore, the first Column in this formula
="Sheet1!"&ADDRESS(IF(ROW()-3<1,1,ROW()-3),IF(COLUMN()-3<1,1,C‌​OLUMN()-3))&":"‌​&ADDRESS(ROW()+3,COLUMN()+3)
is fine. Merely the second column in this formula contains these extra characters. So, I'd like to suggest that you re-type the formula (manually) without copying it from anywhere and you should be fine.

Related

Sorting numbers and strings together, where strings are numbers that can be followed by letters

I need to sort an Excel sheet which has a mixture of actual numbers and text containing numbers possibly followed by text.
For example if the following list was randomised, the end result should be:
54 <-- Actual number
55
56
57
57B <-- Number followed by a letter
57M <-- Yet another letter
58
58M
59
59M
60
60B
61
61M
62
62B
63
64
65
66
90
99
99A
100
100B
100B2
120
120B
I tried a million different ways. However, I can't work out a way to sort the sheet like this.
Is there a way to do this? Some sort of "humanised" sorting?
Add a helper column with the following formula:
=TEXT(IFERROR(LEFT(A1,MIN(IF(ISERROR(--MID(A1,SEQUENCE(LEN(A1)),1)),SEQUENCE(LEN(A1))))-1),A1),"000")&IFERROR(MID(A1,MIN(IF(ISERROR(--MID(A1,SEQUENCE(LEN(A1)),1)),SEQUENCE(LEN(A1)))),LEN(A1)),"")
Then sort on that.
Note: Change the "000" to the same number of digits as the largest number in the list.
Also if one does not have SEQUENCE substitute that part with ROW($ZZ$1:INDEX($ZZ:$ZZ,LEN(A1))) The formula would then also need to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
Sorted on Column A:
Sorted on Column B:

Problems with nested if statement formula

I have in one column age (R2), and I'd like based on age to input into another columns age bands.
The formula I have is:
=IF(R2=" ","I Unknown",IF(AND(R2>0,R2<15),"A Under 15",IF(AND(R2>=15,R2<=24),"B 15 to 24",IF(AND(R2>24,R2<=34),"C 25 to 34",IF(AND(R2>34,R2<=44),"D 35 to 44",IF(AND(R2>44,R2<=54),"E 45 to 54",IF(R2>54,R2<=64,"F 55 to 64",if(and(R2>64,R2<=74,"G 65 to 74",if((r2>74,"H 75 and over")))))))))
Unfortunately with formula above it isn't working but can't figure out why.
You just had a few syntax errors, watch the extra brackets. It helps to just paste these into a text editor especially when the formula gets really long.
The other thing to remember is that you don't need to do an AND statement for every step.
=IF(not(isnumber(R2)),"I Unknown",IF(AND(R2>0,R2<15),"A Under 15",IF(R2<=24,"B 15 to 24",IF(R2<=34,"C 25 to 34",IF(R2<=44,"D 35 to 44",IF(R2<=54,"E 45 to 54",IF(R2<=64,"F 55 to 64",IF(R2<=74,"G 65 to 74","H 75 and over"))))))))
Explanation, first we check if R2 is a real number, if not, say it's unknown.
After that it's just checking the age against each range. At the 3rd IF, we already know that R2 is more than 15, so we just need to check if R2 <=24. Same thing for the next check, no need for AND in every step.
To answer your original problem:
If a value is not 'under 15' in the first clause, you don't have to keep re-examining that condition in the false nest.
=IF(value(R2)<=0, "I Unknown",
IF(R2<15, "A Under 15",
IF(R2<=24, "B 15 to 24",
IF(R2<=34, "C 25 to 34",
IF(R2<=44, "D 35 to 44",
IF(R2<=54, "E 45 to 54",
IF(R2<=64, "F 55 to 64",
if(R2<=74, "G 65 to 74",
if(r2>74, "H 75 and over")))))))))
I think I got the right number of closing brackets.
Although a table lookup would be better, you could even hard-code the limit values into a basic lookup.

Look up Cell data based on Month header in table with two cells as reference

Some days ago i got help from Scott Craner with an formula for a 3D index match which works great.
I have tried expanding on it without any results, hopefully you can point out what i'm doing wrong.
Output list
Group Division Input Verification Differance
G1 1 120 123 =Sum([#[Input]]-[#[Verification])
G2 2 76 110 =Sum([#[Input]]-[#[Verification])
G3 3 110 90 =Sum([#[Input]]-[#[Verification])
G4 4 34 53 =Sum([#[Input]]-[#[Verification])
Data list
Group Division Year Jan Feb Mar Apr
G1 1 2017 123 95 80
G2 2 2017 110 85 75
G3 3 2017 90 80 70
G4 4 2017 53 53 46
Following code is the one im trying to use, using only Group as a lookup i get a value
=INDEX(DataList,MATCH([#Group]:[#Division],DataList[Group]:DataList[Division],0),MATCH(TEXT($A$1,"mmm"),DataList[#Headers],0))
I have tried different variations,
Binding the results together with an &,
Tried binding just one result with & and the other one with a simple :
nothing has produced a good result in some cases i get a result, in others i do not get anything.
If i only use Group as a lookup term it's not an issue, it returns the correct value, but I'm trying to Index match two cells with two other cells.
I have evaluated the code and it does not return a value and I do not know what i'm doing incorrectly

Find all rows that contains 4 specific values?

I am using excel and I have a table of numbers with 6 columns from A to F and more than 1000 rows. For example, from my table,
4 17 37 38 47 53
8 43 54 55 56 60
4 18 21 25 38 57
15 25 37 38 58 59
4 16 19 20 27 43
18 32 47 50 54 56
i want to find if there is at least a row (it must be a row!) that contains the numbers 16 19 20 27. From this example, there is a match, but i don't know how to make a search or formula using four diferent numbers.
I feel like I need to use the match function but can't quite figure it out and I'm not sure about it. Does anyone know how to do this?
Thanks!
This should work:
=IF(AND(OR(A1=16,B1=16,C1=16,D1=16,E1=16,F1=16),OR(A1=19,B1=19,C1=19,D1=19,E1=19,F1=19),OR(A1=20,B1=20,C1=20,D1=20,E1=20,F1=20),OR(A1=27,B1=27,C1=27,D1=27,E1=27,F1=27)),"Yes","No")
Put it in a new column in the table. It will return a Yes if the row contains all 4 values, and a No otherwise. You can then filter the new column of Yes/No to search for a row with Yes
I put the four values you are seeking in I1:L1 and the array of data to be searched in A1:F#. Then in column G create a helper column that concatenates A:F into a delimited string. The formula in G1 is:
=":"&A1&":"&B1&":"&C1&":"&D1&":"&E1&":"&F1&":"
where I've used ":" for the delimiter (you can use any char that's not in your data).
The result in G1 is:
:4:17:37:38:47:53:
Now in H1 use this formula to search:
=NOT(ISERR(FIND(":"&$I$1&":",G1)*FIND(":"&$J$1&":",G1)*FIND(":"&$K$1&":",G1)*FIND(":"&$L$1&":",G1)))
Each FIND will return an INT if the value (with leading and trailing delimiters) is found and #VALUE! otherwise. So the product will be an INT if all values are found and #VALUE! otherwise. Wrapping the FINDs inside an ISERR makes the result prettier (TRUE/FALSE instead of #VALUE!), and inverting with NOT returns TRUE when all 4 values are found and FALSE otherwise.
Hope that helps.
Here's another way --- more elegant (no helper column). As before, I put the four values you are seeking in I1:L1 and the array of data to be searched in A1:F#. Then in column G use this ARRAY formula (CTRL-SHIFT-ENTER):
=NOT(OR(PRODUCT(A1:F1-$I$1)<>0,PRODUCT(A1:F1-$J$1)<>0,PRODUCT(A1:F1-$K$1)<>0,PRODUCT(A1:F1-$L$1)<>0))
Each PRODUCT term checks for the existence of one value and returns 0 when the value is found and a non-zero value otherwise. The results of each of the four PRODUCT terms is tested with <>0 which will return TRUE if a value is not found. Then OR with return TRUE if one or more values are not found and FALSE if all are found. That result is wrapped in a NOT so that the function result is TRUE when all four values are found.

Excel nesting error

I'm using Excel 2013 and I have had to create a If statement which basically chooses a student's grade depending on a certain mark number (obviously, nesting is needed) Here is the If statement I created:
=IF(E2<=20,"N",
IF(OR(E2>=21,E2<=25),4,
IF(OR(E2>=26,E2<=32),"5C",
IF(OR(E2>=33,E2<=38),"5B",
IF(OR(E2>=39, E2<=44), "5A",
IF(OR(E2>=45, E2<=53), "6C",
IF(OR(E2>=54, E2<=61), "6B",
IF(OR(E2>=62, E2<=71), "6A",
IF(OR(E2>=72, E2<=87), "7C",
IF(OR(E2>=88, E2<=103), "7B",
IF(OR(E2>=104, E2<=120), "7A")))))))))))
The error I receive is:
the specified formula cannot be entered because it uses more levels of nesting than allowed in the current file format
My question is, how do I shorten this statement to allow Excel to use it?
Place the logic in the spreadsheet cells. One column for the minimum score, and one column for the grade-:
A B
1 0 N
2 21 4
3 26 5C
4 33 5B
5 39 5A
6 45 6C
7 54 6B
8 72 7C
9 88 7B
10 104 7A
Then do a vlookup to get the grade from the actual score. vlookup will find the highest value in the A column that is less that the lookup value of 38.
In the example vlookup below 38 is the score, A1:B10 is the lookup table 2 is the 2nd column (in this case the B column) that contains the result (the grade).
=VLOOKUP(38, A1:B3, 2, TRUE)
You can also use the following formula.
=LOOKUP(E2;{0;21;26;33;39;45;54;62;72;88;104;121};{"N";4;"5C";"5B";"5A";"6C";"6B";"6A";"7C";"7B";"7C";"No match"})
There are a few different solutions. AND agreements using OR instead of the first that comes to mind.
=IF(E2<=20,"N",
IF(AND(E2>=21,E2<=25),4,
IF(AND(E2>=26,E2<=32),"5C", ...
The best way, in my opinion, is to write a UDF. Then you can use VBA and a CASE statement.
Experiment with this code in VBA to create a UDF named GRADE() - just type it into a MODULE in the VBE:
Function Grade(Marks)
Dim Score As Integer
Score = Marks * 1
Select Case Score
Case 1 To 20
Grade = "N"
Case 21 To 50
Grade = "C"
Case 51 To 90
Grade = "B"
Case 91 To 120
Grade = "A"
End Select
End Function
Then use the Function GRADE() as you would any other function but type the address of the argument - like this GRADE(B7) to use it
=+IF(O3="Negative","Negative",IF(P3="Negative","Negative",IF(Q3="Negative","Negative",IF(R3="Negative","Negative",IF(O3="Refer","Refer",IF(P3="Refer","Refer",IF(Q3="Refer","Refer",IF(R3="Refer","Refer","Positive"))))))))
I find the final status in 4 cells have positive,negative,refer,pending or blank

Resources