• Home
  • Blog
  • Resume
  • Contact
  • Projects
  • Gallery
  • Amit’s Resume
  • About Nagpur
KEEP IN TOUCH

Long formulas??

Sep17
2005
Leave a Comment Written by admin

Are you facing problems with long formulas? We are. So here are some articles, which are quite useful.

-Index and refering
MrExcel1

-ISerror and IsNA and a long formula
MrExcel2

-Exceed 7 Ifs
MrExcel3
ChipPearson1

-named ranges
ChipPearson1

Also, I created this function, which will find if any of the given values exists in the given range. Normally, we would use this

=IF(OR(A1=”Chair”,A1=”Co-Chair”,A1=”Prof”))

But, when the list and formula gets longer it becomes unreadable and takes time to calculate.

Instead you can use this function. Copy and paste the code in a module in the workbook you’re working on. Use this function in any cell where you want to check if multiple values are present or not.
For eg. If you want to check if cell A1 has any one of these values Chair, Interim Chair, Prof.
Enter this formula = Isvalpresent(A1,”Chair”,”Interim Chair”, “Prof”), it will return either True or False
It can take 9 values to check and can be easily increased by changing the code. This function will be very useful when you have long formulas.

Public Function IsvalPresent(IPRange As Range, val1 As Variant, Optional val2 As Variant = “”, Optional val3 As Variant = “”, _
Optional val4 As Variant = “”, Optional val5 As Variant = “”, Optional val6 As Variant = “”, Optional val7 As Variant = “”, Optional val8 As Variant = “”, Optional val9 As Variant = “”) As Boolean
‘
‘ IsvalPresent Macro
‘ Checks for a value if it is present in the given range. Use this function instead of IF and OR functions.
‘

‘
Dim c As Range, arr1 As Variant
arr1 = Array(val1, val2, val3, val4, val5, val6, val7, val8, val9)
For Each c In IPRange
    For i = 0 To 8
        If Not IsNothing(arr1(i)) Then
            If c = arr1(i) Then
                IsvalPresent = True
                Exit Function
            End If
        End If
    Next i
Next c
End Function
Public Function IsNothing(val As Variant) As Boolean
    If val = “” Then IsNothing = True
End Function

Related posts:

  1. True blanks
  2. Flip row or column
Posted in Uncategorized - Tagged Interim Chair, Isvalpresent A1
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
« Boxplots in Excel
» Hide formula bar

No Comments Yet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Tags

Access Alt F8 Books boxplot cells charts count cursor dashboard data mining dbase design error excel excel functions export filter flip LaTex MS query Number Err ODBC pipes Press Alt F11 Public Sub python R random numbers Range Cells report scripting software sparklines SQL SQL server stack columns statistics stemming string tag cloud text mining UDF VBA visualization wildcard

Network

View Ashutosh Nandeshwar's profile on LinkedIn

Recent Comments

  • larry on Access Export to Excel (2007)
  • Betty Chou on Projects
  • Rwill on Access Export to Excel (2007)
  • Bharathi on The search key was not found in any record in Access
  • Michael on The search key was not found in any record in Access

Related Posts

  1. True blanks
  2. Flip row or column

EvoLve theme by Blogatize  •  Powered by WordPress nandeshwar.info