How to find out empty cell reference? - excel

I have the following table:
Roll No Eng Hin Mar Math
1 10 10 10
2 10 10
3 10 10
4 10 10
5 10 10
6 10 10 10
7 10 10 10
8 10 10 10
I need to find out only blank cells and highlight only those students who are left blank. For example, Roll no 1 is blank at Hin column and Roll no 2 is blank at Eng and Math:
Roll No Pending Sub
1 Hin
2 Eng & Math
Can anyone tell me how to get that result?

I have changed the layout of the data in your OP to try to match it to your example and am interpreting "highlight" as more "draw attention to" than any particular formatting.
Assuming Roll No is in A1, please try in say G2 and copied down to suit:
=LEFT(IF(ISBLANK(B2),B$1&" & ","")&IF(ISBLANK(C2),C$1&" & ","")&IF(ISBLANK(D2),D$1&" & ","")&IF(ISBLANK(E2),E$1&" & ",""),LEN(IF(ISBLANK(B2),B$1&" & ","")&IF(ISBLANK(C2),C$1&" & ","")&IF(ISBLANK(D2),D$1&" & ","")&IF(ISBLANK(E2),E$1&" & ",""))-3)

Related

Excel using SUMIF to calculate totals of multiple columns

I'm trying to use Excle's SUMIF to calculate totals of Col1 to Col5 for dates that are similar.
My formula is as follows =SUMIF($A2:$A7,A10,$B2:$F7), but this only gives me the total of a single column.
How can I get the Totals of all the columns based on the date like I've shown in my results.
Date Col 1 Col 2 Col 3 Col 4 Col 5
1/5/2017 1 2 2
1/5/2017 5 3 1
1/5/2017 9 5 5
2/5/2017 10 5 3
2/5/2017 20 10 3
2/5/2017 6 8 1 5
Desired Results
1/5/2017 15 7 7 3 1
2/5/2017 30 11 11 11 8
use below formula in cell B11
=SUMIF($A$2:$A$7,$A11,B$2:B$7)
Per the example you provided, One solution is to use SUMPRODUCT
Multiplies corresponding components in the given arrays, and returns the sum of those products
Microsoft Docs give a thorough example, but per SO etiquette, here is an example in case of link-rot: [FYI, I used absolute reference for easier filling across, arbitrary how you get it done though]
Forumlas shown:
Formula is kind of hard to see without clicking on image:
=SUMPRODUCT(($B$3:$B$8=$B$11)*C3:C8)
This basically breaks down like this, it searches the B:B column for a match, and it will naturally return a true or false for the match, or 0/1 counterparts, and multiplys that by the number found in the column to the right (C3:C8), so it will either be 1 * # = # or 0 * # = 0

Combine cells matching data into one cell

Is there any VBA code or complicated excel function that would assist with what I need done? I export thousands of ref#s with check#s that need to be combined into one cell with the correspond check #. I know I can combine text, and I could probably use a VLUP function with it, but I'm not sure of the exact function string that should be used.
Basically, rows A2:A4 all share the check# 999, so when I run the script or input the function, it should combine in row C2 the ref#s 1 2 3. In the next chk# row it would combine reference#s 4 5, so on and so on (example is in the table below). All separated with spaces. Is this possible? It is very tedious to do it all by hand.
Example...
Ref # Chk # Combined #
1 999 1 2 3
2 999
3 999
4 1000 4 5
5 1000
6 1001 6
7 1002 7
8 1003 8
9 1004 9 10 11 12
10 1004
11 1004
12 1004
13 1005 13 14
14 1005
For a formula answer without the need for vba.
Use a helper column. So in C2 put:
=IF(B2<>B3,A2,A2 & " " & C3)
Then in D2 put:
=IF(B2<>B1,C2,"")
And copy both down.
Then you can hide C.

"The formula refers to a range" error in Excel

Am new to Excel, please help me with this:
A B
2 9 =IF(A2:A6>=7,"1","0")
3 4
4 7
5 4
6 5
For B2 the formula works perfectly fine but in B3 it selects from A3:A6.
I know the concept of Absolute referencing. But here in this example it should basically work without any errors, right?
A B c
2 9 1 =Sum(A2:B2)
3 4 2
4 7 33
5 4 3
6 5 22
The above example works fine. What is the difference between two?
If you want the A2:A6 range to float down as you copy the formula to other rows, use:
=IF(MAX(A2:A6)>=7, 1, 0)
However, if you want row 6 locked as the finite terminator of the range then lock it as absolute with a $ like this,
=IF(MAX(A2:A$6)>=7, 1, 0)
        

Excel - Lookup value in multiple columns

I have a datasheet with multiple columns that I want to search through - ending up with returning the top row value(s) in the found column(s). How to do this?
My idea would be to combine index with match, but I am rather lost for specific ideas...
January February March April May June
1 2 3 4 5 6
7 8 9 10 11 12
2 7 1 8 4 5
9 10 11 12 6 3
E.g. Search for: ID 3 - should return: March, June
Regards,
Nyborg
You need to add a VLOOKUP for each columns and after build the result
Following the Scheme:
A7 -> =IF(IFERROR(VLOOKUP($A$9;A1:A5;1;);"")="";"";A1) and autocomplete
D9 -> =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCATENATE(A7;",";B7;",";C7;",";D7;",";E7;",";F7);",,";",");",,";",");",,";",")
D10 -> =IF(RIGHT(D9;1)=",";LEFT(D9;LEN(D9)-1);D9)
Formula for D9 & D10 it's only to have a good display of the results.
UPDATE Version:
Considering you agree to have the Row 7 ... You can simplyfy using the Result formula:
=INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);1))&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);2));"")&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);3));"")
List it's the name Range of Row 7. The formula shall be apply with Ctrl+Shift+Enter.
This formula collect the first 3 value.
If you want more, add for each nth value you have:
&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);3));"")
changing the last numer (in this case 3) and putting 4, 5, 6 ...
Obviusly if the result can be a lot, have few sense... Consider to use VBA !

Repeat a specific text x number of times in one column taken from another column of Random text strings

I have some Text Values in sheet 1, A4:A400 and for each value in Column A there are 10 codes in non-consecutive cells in Row 1.
I want a formula in "sheet 2" to put each text value 10 times in column A with the code in column B and then repeat the same with a new text value with the same 10 cods.
LIke:
1
2 . . . . . . 5310 5200 3310 3456 3600
3 PK64
4 PK967
5 PK106
6 PK369
7 PK250
8 PK222
It should look like this
1 A B
2 PK64 5310
3 PK64 5200
4 PK64 3310
5 PK64 3456
6 PK64 3600
7 PK967 5310
8 PK967 5200
9 PK967 3310
10 PK967 3456
11 PK967 3600
I used =INT((ROW()-1)/3)+1 but it increments and repeats the number only.
I also used =REPT(B1,ROW()-1/5) but it repeats the text in the same cell with increased number of times as the row number increments.
Assuming that all codes are numeric and with no repetitions you can do this:
With PK's starting at A4
write in J4 the first PK (in your example "PK64")
In K4 write the formula:
=MIN(2:2)
Now write in J5 and K5 the formulas:
=IF(K5=MIN($2:$2);INDEX(A:A;MATCH(J4;A:A;0)+1);J4)
=IF(K4=MAX($2:$2);MIN($2:$2);SMALL($2:$2;RANK(K4;$2:$2;1)+1))
Copy, at the same time, both formulas down and you get the pretended result
Depending on your regional settings you may need to replace ";" by ","

Resources