Fill missing character from the series

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000</SPAN></SPAN>

Hi,</SPAN></SPAN>

Data located in columns C:J in cells C6:J36</SPAN></SPAN>
In the columns L:S I have filled some numbers and in the same rows columns C:J characters are highlighted according in order of the columns (L:C, M:D, N:E, O:F, P:G, Q:H, R:I, And S:J)</SPAN></SPAN>

Series of the character is used 1, X and 2, what I need to find missing character form 1, X or 2 series</SPAN></SPAN>

For example... </SPAN></SPAN>
In the column L, </SPAN></SPAN>
I have filled number 9 in cell L30, in the same row in the column C "X" is highlighted,</SPAN></SPAN>
I have filled number 4 in cell L33, in the same row in the column C "1" is highlighted,</SPAN></SPAN>
I want to check in the column C, below the "1" till last data row 36 which character is missing out of 1, X and 2</SPAN></SPAN>
If C33=1</SPAN>, C34=2</SPAN></SPAN>, C=35=1</SPAN></SPAN>, C36=1</SPAN></SPAN>, so far missing character is "X" </SPAN></SPAN>

I need Formula Or VBA To fill missing character "X" In cell C40,</SPAN></SPAN>

The same rules will be applied for rest of the columns for finding the missing character all missing results are shown in the row 40 in columns C:J </SPAN></SPAN>

Result data example</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTU
1
2
3
4
5P1P2P3P4P5P6P7P8P1P2P3P4P5P6P7P8
612XXX1XX
71111XX11
822211111
9X212X121
102122X212
111X12212X
1211X211113
1311X1X211
1421X11X2X
1522211X2X
16X1211111
17XXX22221
18XX2X122X
191111X121
20X1212X114
21XX11111X
222X2X1XXX
2322X11X1X5
2421X2221X75
25212112X1
262X21X1X1
271XX122216
282X11111163
292111X12X
30X21111119
312111X22X
32X112111X
331211X1114
342XX1111X5
35111111XX9
361211211X39
37
38
39
40X1X21X1XX22
41
42
43
44
Sheet1


Thank you in advance</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Not sure i understand what you're looking for.
Question
Shouldn't the result in F40 be X instead of 1X?

M.
 
Last edited:
Upvote 0
Not sure i understand what you're looking for.
Question
Shouldn't the result in F40 be X instead of 1X?

M.
Hi Marcelo Branco, True the result in F40 should be "X" not the 1X?, sorry it is my error, you are correct.</SPAN></SPAN>

Thank you for observing it</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Upvote 0
Maybe...

Formula in C40 copied across
=IF(ISNA(MATCH(1,INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),1,"")&IF(ISNA(MATCH("X",INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),"X","")&IF(ISNA(MATCH(2,INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),2,"")

M.
 
Upvote 0
Maybe...

Formula in C40 copied across
=IF(ISNA(MATCH(1,INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),1,"")&IF(ISNA(MATCH("X",INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),"X","")&IF(ISNA(MATCH(2,INDEX(C$6:C$36,MATCH(9.99E+307,L$6:L$36)):C$36,0)),2,"")

M.
Thank you Marcelo Branco, for giving a formula solution, it is resulting as request.</SPAN></SPAN>

I forgot to express I keep results lines adding below the row 36, could it be flexible instead row 36 get fix in the formula.
</SPAN></SPAN>

if I fill series of numbers in the column C till data are entered than could be possible take last row reference from the C in to the formula. it is just my thought
</SPAN></SPAN>


Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0
With a formula solution you have to adjust the range. Maybe someone can provide a macro.

M.
 
Upvote 0
With a formula solution you have to adjust the range. Maybe someone can provide a macro.

M.
Hi Marcelo Branco, thank you very much for the response. Till anyone gives the VBA solution, i could solve the situation with your formula, which is perfect for now. I changed the formula as below and applied the Formula in cell C4 and copied across.</SPAN></SPAN>
Code:
[COLOR=#000000]Formula in cell C4 and copied across
[/COLOR]
=IF(ISNA(MATCH(1,INDEX(C6:C5006,MATCH(9.99E+307,L6:L5006)):C5006,0)),1,"")&IF(ISNA(MATCH("X",INDEX(C6:C5006,MATCH(9.99E+307,L6:L5006)):C5006,0)),"X","")&IF(ISNA(MATCH(2,INDEX(C6:C5006,MATCH(9.99E+307,L6:L5006)):C5006,0)),2,"")
I appreciate your help very much.
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Last edited:
Upvote 0
Maybe this macro.
Results placed two rows below the last row with data

Code:
Sub aTest()
    Dim LastRow As Long, LR As Long
    Dim rData As Range, i As Long, rCol As Range
    Dim rSearch As Range, strResult As String
    Dim v As Variant, rFound As Range
        
    LastRow = Cells(Rows.Count, "C").End(xlUp).Row
    Set rData = Range("C6:J" & LastRow)
    
    For Each rCol In rData.Columns
        With rCol.Offset(, 9)
            LR = .Cells.Find(What:="*", after:=.Cells(1), LookIn:=xlValues, _
            Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
            MatchCase:=False, SearchFormat:=False).Row
        End With
        Set rSearch = Range(Cells(LR, rCol.Column), Cells(LastRow, rCol.Column))
        strResult = ""
        For Each v In Array(1, "X", 2)
            Set rFound = rSearch.Find(v)
            If rFound Is Nothing Then strResult = strResult & v
        Next v
       'Result placed 2 rows below the last row with data
        Cells(LastRow + 2, rCol.Column).Value = strResult
    Next rCol
End Sub

M.
 
Upvote 0
Maybe this macro.
Results placed two rows below the last row with data

Code:
Sub aTest()
    Dim LastRow As Long, LR As Long
    Dim rData As Range, i As Long, rCol As Range
    Dim rSearch As Range, strResult As String
    Dim v As Variant, rFound As Range
        
    LastRow = Cells(Rows.Count, "C").End(xlUp).Row
    Set rData = Range("C6:J" & LastRow)
    
    For Each rCol In rData.Columns
        With rCol.Offset(, 9)
            LR = .Cells.Find(What:="*", after:=.Cells(1), LookIn:=xlValues, _
            Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
            MatchCase:=False, SearchFormat:=False).Row
        End With
        Set rSearch = Range(Cells(LR, rCol.Column), Cells(LastRow, rCol.Column))
        strResult = ""
        For Each v In Array(1, "X", 2)
            Set rFound = rSearch.Find(v)
            If rFound Is Nothing Then strResult = strResult & v
        Next v
       'Result placed 2 rows below the last row with data
        Cells(LastRow + 2, rCol.Column).Value = strResult
    Next rCol
End Sub

M.
Hi Marcelo Branco, this is an Amazing!! Solved 100% spot on solution.</SPAN></SPAN>

I appreciate your kind help for giving your precious time and for prompt replay
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan
:)
</SPAN></SPAN>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top