Formula or VB Code in a data sheet

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
543
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Hi and Thanks in advance

i have post earlier some problem and get the solution but that was in complete and also i have lost that post url.

Problem is, i have following sheet

Col ACol B
S.No.Student Work
12
23
36
48
54
62
73
86

<tbody>
</tbody>

In the above sheet i have approx 140 row and in coloumn B, we have approx 70 values

and i want the three different result from this sheet

1 - We will check the value 2, 3 & 6 (S.No. 1, 2 & 3) from the S.No. 4 and when we find the any value we will update it as the given sheet,
After it will check the rest 2 value and we will update it as the given sheet
After getting 2 value, we will start the check last value and update it when we find it according to the given sheet

Col ACol BFirstSecondThird
S.No.Student WorkResultAfter how manyResultAfter how manyResultAfter how many times
12
23
36
48
54
62Yes3
73Yes4
86Yes5

<tbody>
</tbody>

2 - We will check the value 2, 3 & 6 (S.No. 1, 2 & 3) from the S.No. 4 and when we find the any value we will update it as the given sheet,
After that we will again take the value 2,4,8 (S.No. 4, 5 & 6) from the S.No. 7 and when we find the any value we will update it as the given sheet,
After that we will again take the value 8,6,3 (S.No. 7, 8 & 9) from the S.No. 10 and when we find the any value we will update it as the given sheet,

Col ACol B
S.No.Student WorkResultAfter How many times
12
23
36
48
54
62Yes3
73
86
98Yes3
104
115
120
130
147
153Yes6

<tbody>
</tbody>

Hope will get a solution....
 
We have already told you that i have search and not find
All the posts are there.

So if you did not find it, then either:
1. You actually did not post it to this site, but another one.
2. You did not look through all the posts.
3. You were mistaken.

Also that solutions was incomplete.
That was not clear from your original post, as you said:
i have post earlier some problem and get the solution but that was in complete and also i have lost that post url.
"Complete" and "Incomplete" mean very different things (they actually mean the opposite of one another). So I thought you were saying it was complete.

if possible pls provide any formula or code,
I am sorry, but I don't think I can be of much assistance. Quite frankly, I have read through it a few times, and I really do not understand your question.
 
Last edited:
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi Joe4, really you are great for giving me time and posting the comment,

believe me, i have no intention of wasting of any body time and you have other work also but pls help me to solve this through any formula or code.


now make it simple, can you please solve this if possible


[TABLE="class: cms_table"]
<tbody>[TR]
[TH="align: center"]Col A[/TH]
[TH="align: center"]Col B[/TH]
[/TR]
[TR]
[TD]S.No.[/TD]
[TD]Student Work[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]


In the above sheet i have approx 140 row and in coloumn B, we have approx 70 values

and i want the three different result from this sheet

1 - We will check the value 2, 3 & 6 (S.No. 1, 2 & 3) from the S.No. 4 and when we find the any value we will update it as the given sheet,
After it will check the rest 2 value and we will update it as the given sheet
After getting 2 value, we will start the check last value and update it when we find it according to the given sheet

[TABLE="class: cms_table"]
<tbody>[TR]
[TH="align: center"]Col A[/TH]
[TH="align: center"]Col B[/TH]
[TH="align: center"]First[/TH]
[TH="align: center"][/TH]
[TH="align: center"]Second[/TH]
[TH="align: center"][/TH]
[TH="align: center"]Third[/TH]
[TH="align: center"][/TH]
[/TR]
[TR]
[TD]S.No.[/TD]
[TD]Student Work[/TD]
[TD]Result[/TD]
[TD]After how many[/TD]
[TD]Result[/TD]
[TD]After how many[/TD]
[TD]Result[/TD]
[TD]After how many times[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]Yes[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]


2 - We will check the value 2, 3 & 6 (S.No. 1, 2 & 3) from the S.No. 4 and when we find the any value we will update it as the given sheet,
After that we will again take the value 2,4,8 (S.No. 4, 5 & 6) from the S.No. 7 and when we find the any value we will update it as the given sheet,
After that we will again take the value 8,6,3 (S.No. 7, 8 & 9) from the S.No. 10 and when we find the any value we will update it as the given sheet,

[TABLE="class: cms_table"]
<tbody>[TR]
[TH="align: center"]Col A[/TH]
[TH="align: center"]Col B[/TH]
[TH="align: center"][/TH]
[TH="align: center"][/TH]
[/TR]
[TR]
[TD]S.No.[/TD]
[TD]Student Work[/TD]
[TD]Result[/TD]
[TD]After How many times[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]Yes[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]8[/TD]
[TD]Yes[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]3[/TD]
[TD]Yes[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]


Hope will get a solution....
 
Upvote 0
pls consider my request and provide code or formula if any
 
Upvote 0
hi , find the post

thanks.

this is the code

Try this:-
Answer starts "E1", it is not the same as Yours !!!
NB:- Why when your looking for "5,6,7" , do you find "5" instead of "6" which comes after "6", and give it "6" rows when it seems to be "3" ????
Code:
Sub MG28May04
Dim Rng As Range, Dn As Range, Num As String, c As Long, K As Variant
Set Rng = Range("B5", Range("B" & Rows.Count).End(xlUp))
Num = Join(Application.Transpose(Range("B2:B4")), ",")

With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare

For Each Dn In Rng
c = c + 1
If InStr(Num, Dn.Value) > 0 Then
Num = Join(Application.Transpose(Dn.Offset(-2).Resize(3)), ",")
.Item(c) = .Item(c) + 1
c = 0
End If
Next Dn
c = 0

For Each K In .keys
c = c + 1
Cells(c, "E") = "After " & K & " = " & .Item(K)
Next K
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,638
Members
452,663
Latest member
MEMEH

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