Hello everyone,
Please take a look at this formula and see what's wrong:
x=Application.WorksheetFunction.LOOKUP(2,1/(WorksheetFunction.COUNTIF(Sheet8.Range("B3:B351"),"">"" & Sheet8.Range("B3:B351")=0),Sheet8.Range("B3:B351"))
Thank you.
Hello everyone,
Please take a look at this formula and see what's wrong:
x=Application.WorksheetFunction.LOOKUP(2,1/(WorksheetFunction.COUNTIF(Sheet8.Range("B3:B351"),"">"" & Sheet8.Range("B3:B351")=0),Sheet8.Range("B3:B351"))
Thank you.
It is a lot better to post a sample work sheet.
however.
Lookup format is = LOOKUP( value, lookup_range, [result_range] )
So you are looking for the value 2
Your Range to look in is: 1/(WorksheetFunction.COUNTIF(Sheet8.Range("B3:B351"). ie 1 ( what is the 1 doing? = Error ) / Error = Error
CountIf format =COUNTIF (range, criteria). You have a range but no criteria
There is more but that is enough to be getting on with.
Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
My General Rules if you want my help. Not aimed at any person in particular:
1. Please Make Requests not demands, none of us get paid here.
2. Check back on your post regularly. I will not return to a post after 4 days.
If it is not important to you then it definitely is not important to me.
mehmetcik,
Thank you for your reply. I uploaded a sample workbook which contains the formula that works but when try to build it in a VB module, it fails. it says "Type Mismatched". Could you take a look at the formula in module1.
Please Login or Register to view this content.
Thank you so much it works!
Question: 1)
How come when I do this, it doesn't work.
x = Application.Evaluate("=LOOKUP(2,1/(COUNTIF(rng.address,"">""& rng.address)=0),rng.address)")
x = Application.Evaluate("=LOOKUP(2,1/(COUNTIF(rng,"">""& rng)=0),rng)")
both return Error 2029
Question: 2)
What's the difference between Evaluate and WorksheetFunction?
Thanks again.
I honestly don't know. After you get so far.. It is only trial and error.
I will see if I can the rng to work
Please Login or Register to view this content.
Last edited by mehmetcik; 03-03-2020 at 10:13 PM.
Thanks, it would great to get the rng to work. I also try making the range into a table and the formula works on table/field name like this x = Application.Evaluate("=LOOKUP(2,1/(COUNTIF(ID[ID],"">""&ID[ID])=0),ID[ID])")
strange
Last edited by Xceller; 03-03-2020 at 10:37 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks