Excel Hlookup function returning the first character in table - excel

I am using Hlookup to find in a row where the value is "A", and then subsequently take a binary value in the same column and use this as the selected cells value.
I am only using the formula bar for this part. The cells formula is:
"=HLOOKUP("A",A13:Z19,1)"
Row 13: SNPHUATVBKWJZYMQGXFCROEILD (Each character is assigned to an individual cell).
In row 19, each cell is taken up by 5 binary digits, so to keep things tidy I will write the decimal numbers:
10 3 2 20 18 6 24 2 12 21 30 4 6 26 19 22 9 13 5 24 0 31 12 15 24 9
The issue is that, while my formula should return 6, as that is the corresponding value within the same column as the letter "A", it returns 9, which is the first cell on the top right of the search criteria table.
Also worth noting is that if I post in a different cell a similar formula but perhaps change the search criteria to a different character such as "H", then the same error will occur, returning a 9.
Thank you so much in advance!

Related

Excel: How to not count a particular cell on condition?

I need to calculate a column having many cells but I want to not calculate particular cells on condition. For example:
Scenario:
Sr No Marks
1 46
2 33
3 44
4 32
5 11
6 99
7 27
8 98
I want to get the sum of marks but only those cells should be added whom marks are more than 50. What formula should use?
We can use SUMIF here:
=SUMIF(B2:B9, ">50")
This assumes that your Marks column is in column B, and that the first data point is on the second row.
Edit:
If you want to take the average value of marks, where the mark is over 50, then we can also use COUNTIF:
=SUMIF(B2:B9, ">50") / COUNTIF(B2:B9, ">50")

Count the number of duplicates between rows excel

I’m wondering if someone can tell me how to count the number of duplicates that occur between 2 rows in excel? I’ve read lots of posts about counting duplicates in general, but it’s not quite what I’m looking for.
In the below example, I want to indicate how many numbers are repeated from the previous row. For example, Row 1 has 3 numbers repeating from Row 2. Row 2 has 1 number repeating from Row 3. Row 3 has 2 numbers repeating from Row 4. I don’t need to know what numbers or how many times each number was repeated, I just need to know how many occurrences of duplicates there are. Each number would be in its own cell. Is this even possible?
Row 1> 20 22 40 41 42 47
Row 2> 3 37 40 41 47 49
Row 3> 1 2 3 4 5 6
Row 4> 2 5 17 20 25 30
Use COUNTIF() wrapped in a SUM() as an array formula:
=SUM(COUNTIF(A2:F2,A1:F1))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly Excel will put {} around the formula.
Put the formula in the first desired output cell, Hit Ctrl-Shift-Enter. Then copy down.

Excel formula using countif

There are 11 numbers in a column.
5
5
5
5
12
13
5
9
2
5
10
I need to build a formula that tells me how many times occurs the following situation: Number is bigger than each of previous four numbers.
In this case the situation occurs 3 times. By:
12 bigger than 5;5;5;5
13 bigger than 12;5;5;5
10 bigger than 5;2;9;5
Assuming your data starts in A1 you can use if() and max() to do this. Add this to B5 (next to the 12 in your example):
=IF(MAX(A1:A4)<A5, 1, "")
This will put a 1 next to 12. You can copy this formula down to find the other values where this is true.
This works by looking at the MAX() value of the previous 4 values. IF() they are higher than the current value, then it prints a 1.

Index/Match values from a column using a grid of a different length (Excel 2010)

I am trying to index match values from a long column to a grid of a different length. It looks like this
Word Number Column X Column Y Column Z
This 55 55 33 12
is 62 62 42 18
The 78 78 31 24
42
31
12
18
24
33
The grid (Column X,Y,Z) contains all the values from the Number Column. What I am trying to do is basically index the "Word" column, using a value from the "Number" Column, and looking it up in the value array of X Y Z.
Example (because this is confusing):
Input the Value 33 from the Number column, look for the value in the columns XYZ, and then return the Word "This".
Input the Value 18 from the number column, look for the value in columns XYZ, return the word "is"
etc...
Any help would be very much appreciated!
there is a quicker way and shorter formula to do this:
=IFERROR(INDEX(A:A,IFERROR(MATCH(B2,C:C,0),IFERROR(MATCH(B2,D:D,0),MATCH(B2,E:E,0))),1),"not found")
paste that into, any column really, into row 2 and drag down, it will return the words you require, if value not found it will return "not found"
Here is your spreadsheet starting at cell A1 (without your headers):
A B C D E
1 This 55 55 33 12
2 is 62 62 42 18
3 The 78 45 31 24
4 42
5 31
6 12
7 18
8 24
9 33
10
11 Input: 24
12 Output: The
Copy this into cell C10, and drag the formula across to cell E10:
=IF(ISERROR(IF(ISERROR(IF(ISERROR(MATCH($B$11,C1:C3,0)),"",CONCATENATE("A",MATCH($B$11,C1:C3,0)))),"",INDIRECT(IF(ISERROR(MATCH($B$11,C1:C3,0)),"",CONCATENATE("A",MATCH($B$11,C1:C3,0)))))),"",IF(ISERROR(IF(ISERROR(MATCH($B$11,C1:C3,0)),"",CONCATENATE("A",MATCH($B$11,C1:C3,0)))),"",INDIRECT(IF(ISERROR(MATCH($B$11,C1:C3,0)),"",CONCATENATE("A",MATCH($B$11,C1:C3,0))))))
Copy this to the "output" cell B12 and use cell B11 as your "input":
=CONCATENATE(C10,D10,E10)
VIOLA!!! You're done!
Proof:
The MATCH() function will look for your value in an array (the range). If it finds it, it returns the index of that array (indexed at 1), otherwise it throws an error. Be sure to set the 3rd argument to "0" so that it only looks for EXACT matches.
Paste this into C14:
=MATCH($B$11,C1:C3,0)
Next, we check if the MATCH() function did indeed throw an error. Paste this into C15:
=IF(ISERROR(C14),"",C14)
Now we have the row number of our matched value, so we will use the CONCATENATE() function to join it to our "word column", A, for use in the next step. Paste this into C16:
=CONCATENATE("A",C15)
Using that string from above, use the INDIRECT() function to turn it into an actual cell reference. Paste this into C17:
=INDIRECT(C16)
And finally, check if a legitimate cell reference was created. If so, return the word, otherwise return "". Paste this into C18:
=IF(ISERROR(C17),"",C17)
Lastly, drag the formulas from C14:C18 to E14:E18, and concatenate the results. The cells in row 18 should match the cells in row 10.
Hope this helps :)

Partial Sums from a Given Column

I was wondering if there is a quick way to have Excel sum up chunks of a selected column based on where blanks appear in that column. For example, the column might look like:
10
12
15
11
2
3
10
13
14
14
13
1
9
8
6
and ideally each partial total would be placed where the first element being summed was previously. Can this be done without VBA?
Leave B1 empty, In B2 enter:
=IF(A2<>"","",SUM($A$1:A2)-SUM($B$1:B1))
and copy down............should look like:

Resources