Forum Discussion

Stephen Jon's avatar
Stephen Jon
Copper Contributor
Feb 23, 2018

Excel 2007 Problem with an IF statement . Help

Hi Folks, I'd appreciate any help and many thanks in advance for taking the time.

 

I've excel 2007 and I'm trying to built a table . 

column A will contain a number of random figures from -1 to 100.

 

The table starting in column C through to column AB will run  parallel 

and each column being a category  1, 2-5, 6-10, 11-20, 21-30 and so on 

 

below is the formula that when placed  in C2 will show the result of 1 if 1 is in that cell

=IF(ISNUMBER(SEARCH("1",A2)),A2,"")

 

the problem I have is how do I formulate code where i need  a range from 2-5 ?

so if 3.3 turns up in cell A2 3.3 will show in the category 1-5

 

I can only do single digits and I need to be able to cover a range of numbers and those in between up to 2 decimal place

 

 

 

7 Replies

  • Willy Lau's avatar
    Willy Lau
    Iron Contributor
    "each column being a category 1, 2-5, 6-10, 11-20, 21-30 and so on"

    vs

    "so if 3.3 turns up in cell A2 3.3 will show in the category 1-5"

    Is "1" a category, or "1-5" is a category?
    • Stephen Jon's avatar
      Stephen Jon
      Copper Contributor

      Column A   blank B.   1 C.    1-5 D .  5-10 E.  10-20 F.   20-30 G.    30-40 H.   

            3.5                                      3.5

            1                              1

            10.7                                                 10.7

            2.4                                      2.4

            22.3                                                                                22.3

            35.6                                                                                                   35.6

       

           

      Above is how I want it to look . 

      Column A are random numbers anything from -1 up to 100

      As the random numbers are inputted to column A , it automatically appears in the table under the right category and in line with the relevant data input on the same line .

       

      I hope that helps 

       

      • Willy Lau's avatar
        Willy Lau
        Iron Contributor

        Column C

        =IF($A2 = $C$1, $A2, "")

         

        Column D to last Column

        =IF(AND($A2>VALUE(LEFT(D$1, FIND("-", D$1)-1)), $A2<=VALUE(MID(D$1, FIND("-", D$1)+1, 255))), $A2, "")

         

  • Stephen Jon's avatar
    Stephen Jon
    Copper Contributor
    I hope I've explained it correctly , if not please message so I can help clarify

Resources