+ Reply to Thread
Results 1 to 7 of 7

Ascending order and IF

  1. #1
    Registered User
    Join Date
    02-06-2007
    Posts
    12

    Ascending order and IF

    Hi
    I have a curly one here and wondering if this is possible.

    I have data as follows

    | F600 |
    | 342 |
    | F602 |
    | F601 |
    | NONE |
    | 350 |
    | 345 |

    I want to move all numbers into a column in ascending order. If it is a number with F in front I want to place YES in the adjacent column on the right. If a number without an F I want a YES in 2 colums to the right. If it has NONE in the field I want it to be ignored. So to look like as follows

    | 342 | NO | YES |
    | 345 | NO | YES |
    | 350 | NO | YES |
    | 600 | YES | NO |
    | 601 | YES | NO |
    | 602 | YES | NO |

    I dont know if its possible. But it would be awesome if it could be done.

    Thanks

    PS Ignore the "NO"s. I dont need them I just put them in as the layout of the diagram got screwy with just nothing in there.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by kookinuttz
    Hi
    I have a curly one here and wondering if this is possible.

    I have data as follows

    | F600 |
    | 342 |
    | F602 |
    | F601 |
    | NONE |
    | 350 |
    | 345 |

    I want to move all numbers into a column in ascending order. If it is a number with F in front I want to place YES in the adjacent column on the right. If a number without an F I want a YES in 2 colums to the right. If it has NONE in the field I want it to be ignored. So to look like as follows

    | 342 | NO | YES |
    | 345 | NO | YES |
    | 350 | NO | YES |
    | 600 | YES | NO |
    | 601 | YES | NO |
    | 602 | YES | NO |

    I dont know if its possible. But it would be awesome if it could be done.

    Thanks

    PS Ignore the "NO"s. I dont need them I just put them in as the layout of the diagram got screwy with just nothing in there.
    Hi,

    In cells B1, C1 & D1 put

    =IF(LEFT(A1,1)="F",VALUE(MID(A1,2,LEN(A1)-1)),A1)
    =IF(LEFT(A1,1)="F","Yes","No")
    =IF(LEFT(A1,1)="F","No","Yes")

    and formula fill those down to the end of your data,
    then
    select those columns and Copy
    Paste special = Values back over themselves.

    delete column A and sort over the new column A

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    02-06-2007
    Posts
    12
    Thanks for that, is ther a way to sort via a formula???

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by kookinuttz
    Thanks for that, is ther a way to sort via a formula???
    no, a formula can affect only the cell it is in.

    Select the Data to sort (click above the 1 in row 1, left of A for A column header) and Data, Sort, no header, column A ascending.

    hth
    ---

  5. #5
    Registered User
    Join Date
    02-06-2007
    Posts
    12
    Ok thanks heaps. Still some more i need to do but i gotta work out how i wanna do it. Thanks again

  6. #6
    Registered User
    Join Date
    02-06-2007
    Posts
    12
    Ok i have another problem with the same data


    | F600 |
    | 342 |
    | F602 |
    | F601 |
    | NONE |
    | 350 |
    | 345 |
    | E000 |
    | E002 |

    but I have other data such as E000 and NONE which I want to produce a no result in both comlums

    A B C
    | 342 | NO | YES |
    | 345 | NO | YES |
    | 350 | NO | YES |
    | 600 | YES | NO |
    | 601 | YES | NO |
    | 602 | YES | NO |
    | E000 | No | No |
    | E002 | No | No |
    | NONE | No | No |


    Your forumla above works great buth produces a yes if the first character is not an F. I want it to produce a yes in column c if the first character is a number. A "no" in both colums if the first character is either a "N" or "E"

    Thanks for your time

  7. #7
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by kookinuttz
    Ok i have another problem with the same data


    | F600 |
    | 342 |
    | F602 |
    | F601 |
    | NONE |
    | 350 |
    | 345 |
    | E000 |
    | E002 |

    but I have other data such as E000 and NONE which I want to produce a no result in both comlums

    A B C
    | 342 | NO | YES |
    | 345 | NO | YES |
    | 350 | NO | YES |
    | 600 | YES | NO |
    | 601 | YES | NO |
    | 602 | YES | NO |
    | E000 | No | No |
    | E002 | No | No |
    | NONE | No | No |


    Your forumla above works great buth produces a yes if the first character is not an F. I want it to produce a yes in column c if the first character is a number. A "no" in both colums if the first character is either a "N" or "E"

    Thanks for your time
    In cells B1, C1 & D1 put

    =IF(LEFT(A1,1)="E",VALUE(MID(A1,2,LEN(A1)-1)),If(A1="NONE",0,A1))
    =IF(OR(LEFT(A1,1)="E",Left(A1,1)="N"),"No","Yes")
    =IF(OR(LEFT(A1,1)="E",Left(A1,1)="N"),"No","")

    hth
    ---
    Last edited by Bryan Hessey; 02-07-2007 at 08:32 AM.

+ 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