+ Reply to Thread
Results 1 to 7 of 7

If condition based on the values

  1. #1
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    If condition based on the values

    Hi,

    Need your help please.

    I have numbers in column A. I am trying to write an IF condition formula. If the number in A2 is between 0 and 1 like 0.5, 0.8 etc, the result needs to come as "0 to 1". In the same way if the number in A2 is between 1 and 2, result is "1 to 2". A2 having number between 2 and 3, result is "2 to 3". A2 having any number more than 3 need to come as "more than 3"

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,811

    Re: If condition based on the values

    Try this:

    =LOOKUP(A1,{0,1.000000001,2.0000000001,3.000000001},{"0 to 1","1 to 2","2 to 3","More than 3"})

    or this (depending on what you want to happen):

    =LOOKUP(A1,{0,1,2,3},{"0 to 1","1 to 2","2 to 3","More than 3"})
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: If condition based on the values

    Or try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or this depending what should happen:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by HansDouwe; 07-26-2023 at 08:09 AM.

  4. #4
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: If condition based on the values

    Quote Originally Posted by AliGW View Post
    Try this:

    =LOOKUP(A1,{0,1.000000001,2.0000000001,3.000000001},{"0 to 1","1 to 2","2 to 3","More than 3"})

    or this (depending on what you want to happen):

    =LOOKUP(A1,{0,1,2,3},{"0 to 1","1 to 2","2 to 3","More than 3"})
    Thank you so much and both the formulas are working as expected..

  5. #5
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: If condition based on the values

    Quote Originally Posted by HansDouwe View Post
    Or try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or this depending what should happen:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you so much.. The formulas are working as expected..

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,811

    Re: If condition based on the values

    You're welcome.

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: If condition based on the values

    You are Welcome! Thanks for the feedback and rep . Glad to have helped.

+ 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. [SOLVED] VBA - Paste Values based on a Condition
    By sighlent1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-16-2022, 04:59 PM
  2. Using VBA to delete values based on a condition
    By KatjaL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2015, 09:50 AM
  3. [SOLVED] If condition based on the values
    By arun.sj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-17-2014, 07:27 AM
  4. Insert Row and Values based upon condition
    By btamulis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2014, 01:52 PM
  5. Average Values based on Condition
    By flyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2011, 09:23 AM
  6. Retrieve values based on two condition
    By roshankp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2010, 06:04 AM
  7. Sum the values in cells based on the condition
    By deviaug28 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-04-2009, 08:14 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