+ Reply to Thread
Results 1 to 3 of 3

Using an IF function, with an exception

  1. #1
    Registered User
    Join Date
    10-11-2007
    Posts
    2

    Using an IF function, with an exception

    I have a column of codes. The codes are numbers with one decimal place and range from 1.0 to 3.9.

    Each of these codes resides in a section. It's pretty simple... any codes between (and inclusive of) 1.0 and 1.9 are in section "1", 2.0-2.9 = section "2", and 3.0-3.9 = section "3". There is one exception. Code 2.5 actually resides in section "3".

    I'd like to look at the column of codes, and in the next column, have Excel determine what section that code belongs in.

    Currently, I'm using the following function to assign a code, but it does not take into account the single exception. Can anyone help?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try

    =IF(A2="","",IF(A2=2.5,3,INT(A2)))

    If you need the result to be text change to

    =IF(A2="","",IF(A2=2.5,3,INT(A2)))&""

  3. #3
    Registered User
    Join Date
    10-11-2007
    Posts
    2
    That did the trick... thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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