+ Reply to Thread
Results 1 to 6 of 6

if else formula for dynamic range

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    8

    if else formula for dynamic range

    Hi,

    i need help again for a formula to use in a dynamic range.

    Emp Id Experience(yrs) Tenure
    123 4.5 4-5 yrs
    124 0.8 0-1 yrs
    535 6 yrs > 5 yrs


    Basically i have a dynamic range of emp Id and Experience, i need to write a formula to bring values like (0-1 yrs, 1-2 yrs, etc) in column Tenure.

    for the below code (truncated all ifs and else to avoid clutter), error arises: object variable or with block variable not set

    Please Login or Register  to view this content.
    Thanks in advance,
    Anjale
    Last edited by anjalive; 04-21-2015 at 01:38 AM.

  2. #2
    Registered User
    Join Date
    12-10-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: if else formula for dynamic range

    You need to 'Set' your ranges like you did with your worksheet

    Please Login or Register  to view this content.
    Last edited by sericom; 04-21-2015 at 01:51 AM.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: if else formula for dynamic range

    Try this untested code

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    08-27-2012
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: if else formula for dynamic range

    Oops.. my bad.. Thanks for pointing it out.
    Quote Originally Posted by sericom View Post
    You need to 'Set' your ranges

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    Hyd
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: if else formula for dynamic range

    It works like a charm but sResult is calculated till row in excel rather than last row in-sync with dynamic Range E22.
    As sResult is a string, i cant use set.

    Any pointers?

    Quote Originally Posted by :) Sixthsense :) View Post
    Try this untested code

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: if else formula for dynamic range

    I don't know what you are trying to point out

    I am resetting sResult to none for each loop in the below code to avoid false result

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamic Range Formula
    By amartin575 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-07-2014, 04:32 PM
  2. [SOLVED] chart based on dynamic range which resizes as per data in range-formula / vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2014, 04:02 PM
  3. [SOLVED] Change Static Range of Formula to Dynamic Range
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2014, 10:15 AM
  4. Dynamic Range and using in a formula
    By bwaard in forum Excel General
    Replies: 2
    Last Post: 03-24-2012, 07:27 PM
  5. Replies: 2
    Last Post: 02-02-2006, 04:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1