Turn Formula in Evaluate Function

Adeel1

New Member
Joined
Sep 29, 2019
Messages
21
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All

Hi All

below formula is working fine but when i try to put in code this is not working i can do with loop but i want to get without loop does this possible, please help

=IFERROR(MID(INDEX($A$3:$A$17,AGGREGATE(15,6,ROW($A$3:$A$17)-2/((--MID($A$3:$A$17,6,2)=65)+(--MID($A$3:$A$17,6,2)=66)),ROW(INDIRECT("1:"&SUM((--MID($A$3:$A$17,6,2)=65)+(--MID($A$3:$A$17,6,2)=66)))))),6,255),"")
VBA Code:
Cells(3, "c") = Evaluate("IFERROR(MID(INDEX($A$3:$A$" & p & ",AGGREGATE(15,6,ROW($A$3:$A$" & p & ")-2/((--MID($A$3:$A$" & p & ",6,2)=65)+(--MID($A$3:$A$" & p & ",6,2)=66)),ROW(INDIRECT(""1:""&SUM((--MID($A$3:$A$" & p & ",6,2)=65)+(--MID($A$3:$A$" & p & ",6,2)=66)))))),6,255),"""")")
 

Attachments

  • Capture.PNG
    Capture.PNG
    16.5 KB · Views: 2

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that.
As you are on 365, why not use the filter function like
VBA Code:
Sub Adeel()
   Dim x As Variant
   
   With Range("A3", Range("A" & Rows.Count).End(xlUp))
      x = Evaluate(Replace("FILTER(MID(@,6,255),(MID(@,6,2)=""65"")+(MID(@,6,2)=""66""))", "@", .Address))
   End With
   If Not IsError(x) Then Cells(3, 3).Resize(UBound(x)).Value = x
End Sub
 
Upvote 0
thnx sir for help, some questions normal formula will be like =FILTER(MID(A3:A17,6,255),(--MID(A3:A17,6,2)=65)+(--MID(A3:A17,6,2)=66)) as per solution suggested you
what is @ in mid function(in code) what it will return, please

Adeel
 
Upvote 0
The @ is replaced with the .Address, just a shorthand way of doing it.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,759
Messages
6,126,728
Members
449,332
Latest member
nokoloina

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