Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Oct 2014
    Posts
    24
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Another if statement

    I have an if statement that only works for multiple numbers with commas but when i have a single number it does not work. Why does this statement not work for singe numbers?

    cells in C____if statement results

    16_____________FALSE______________=IF(C16="16",CON CATENATE(TEXT(B16,"0000"),"_D16"))
    82_____________FALSE______________ =IF(C17="82",CONCATENATE(TEXT(B17,"0000"),"_D82"))
    01,92,95,96 _____0000_D01_______ =IF(C18="01,92,95,96",CONCATENATE(TEXT(B18,"0000") ,"_D01"))
    Last edited by Herman Escobedo; 2014-10-31 at 14:22.

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,179
    Thanks
    47
    Thanked 983 Times in 913 Posts
    Probably because you are doing a text comparison - you have quoted numbers in the if statement - and the numbers are numbers, not text. Try this: =IF(C16=16,CON CATENATE(TEXT(B16,"0000"),"_D16"))

    cheers, Paul

  3. The Following User Says Thank You to Paul T For This Useful Post:

    Herman Escobedo (2014-10-31)

  4. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,634
    Thanks
    115
    Thanked 649 Times in 592 Posts
    I think Paul is correct. Going along with his thinking, this modification will evaluate the 16 as a number if it is either text or a number:

    =IF(VALUE(C16)=16,CONCATENATE(TEXT(B16,"0000"),"_D 16"))

    HTH,
    Maud

  5. The Following User Says Thank You to Maudibe For This Useful Post:

    Herman Escobedo (2014-10-31)

  6. #4
    New Lounger
    Join Date
    Oct 2014
    Posts
    24
    Thanks
    19
    Thanked 0 Times in 0 Posts
    It works perfect, Thanks

Posting Permissions

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