Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
VBA function to replace nested IFs
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="myemail.an, post: 6291473"] I'm sorry, I guess I didn't word my question too well. When I said I'd like to avoid nested IFs, I actually meant that I'd like to avoid nested IFs as worksheet functions, i.e. I want to avoid writing a worksheet function like: =IF(CT4>0,IF(CT4>3,IF(CT4>5,IF(CT4>7,IF(CT4>10,15,12),7),3),2),-5) Writing a VBA function with nested IFs or nested Select Case clauses would be fine; however, since I have over 20 parameters, and the thresholds change for each of those, I'd have to write over 20. It would be ideal if I could write just one VBA function, and then use it for all the 20+ parameters I have to work with. Something like: ClassificationFunction(Inputvalue, Threshold1,Threshold2,Threshold3,Output1, Output2,Output3,Output4) The problem is that the number of thresholds is different for every parameter. Is there a way to generalize the function? [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
VBA function to replace nested IFs
Top