+ Reply to Thread
Results 1 to 5 of 5

Trouble Finding Correct Formula to Sort Data

  1. #1
    Registered User
    Join Date
    02-15-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Trouble Finding Correct Formula to Sort Data

    Hello All!

    Most usually I can look back through previous posts to find my answers here, but this one I just cannot get on my own no matter what function I use (Countif, Countifs, Sumproduct). I will explain it as best as I can and I will attach example spreadsheets to show what I am doing with data. Thanks in advance for any help. Here goes:

    1) I have raw equipment data in SAP that I export to an excel file on my computer (example of output is the file "Raw_Export")

    2) I open this file and do the following:
    a) Format the entire sheet as general format so that I can add formulas to the sheet prior to extracting data if not it will not recognize my formulas.
    b) Format the reference date column as date type because general format changes it to an integer
    c) I insert a row in front of the equipment column and enter the formula =IF(E2<>"",LEFT(E2,9),"NONE") and copy this down the entire inserted column so that I have no blank rows in this column.
    d) I then insert a row in front of the System Status column and enter the formula =LEFT(L2,4) and copy this down the entire inserted column to pull out the last condition of the equipment for sorting.
    All of this work can be seen in the file called "Adjusted_Export".

    Here is what I need to do:
    In the workbook "Chart" I need to count the rows based on the criteria of 1)Equipment number (column D "Adjusted_Export"), 2)System Condition (column G in "Adjusted_Export"), and 3) 4 letter code in column K of "Adjusted_Export".

    For example if you open the "Chart" file and use cell B3 as my first example I would need to count the number of rows in "Adjusted_Export" where the equipment number in Column D is between SH100-000 and SH240-999, the system condition is = 5. Cell C3 would be the exact same as B3 plus the added condition of column K is TECO. B4 would be the same as B3 only System condition is <>5. C4 would be the same as B4 plus the added condition of TECO.

    I am sorry for the length of this post, just trying to give as much detail as possible. As I said I have tried everything that I can think of and nothing has worked. The best I ever get out of anything is a #VALUE return. I have had success with sumif when pulling values from other sheets exported in this same way before, but no dice here. Also anything is fair game at this point, so if formatting "Raw_Data" file a different way works better that is fine. I only wanted to show how I have worked the export previously. Again thanks in advance for any help. If I have not been clear enough with what I need just let me know and I will try to explain in more detail.

    Raw_Export.xlsx
    Adjusted_Export.xlsx
    Chart.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Trouble Finding Correct Formula to Sort Data

    Your post has to be the most descriptive request I've seen so far. Kudos! As for the solution, try this...

    In column M of your "Adjusted_Export" file put this formula in column M
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy it down for all records.

    Now for the "Sort Data" tab in the "Chart" file put the following equations in the corresponding cells:
    B3
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B4
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    C3
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    C4
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    * as a side note, I combined the two workbooks together to make it easier formula-wise.
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  3. #3
    Registered User
    Join Date
    02-15-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Trouble Finding Correct Formula to Sort Data

    Craig,

    Thank you for your assistance. However, when I type your code into the "Adjusted_Export" column M I get the #VALUE! Yet again. I see what you are trying to do with the mid statement to extract the machine number but my sheet does not seem to like that. Also I have different modules that will break out in mid machine number. For example one of my cells might start with SH420-075 and got through SH450-320. So I have to use the entire machine number. I can disregard the first two alpha characters though so it would be 2 three digit numbers seperated by the hyphen.

    I have the feeling that I am missing something with my book that keeps causing me to get the #VALUE! but I cannot find what it is.

    Thanks for the quick reply!

  4. #4
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Trouble Finding Correct Formula to Sort Data

    The VALUE() function should have turned any non alphanumeric into a number, otherwise an error (which was fine for my formulas purposes). Try changing the format of the column to number or general.

    As for the machine numbers, you could use the formula =RIGHT(D2,3) in column N and adjust my COUNTIFS() with the additional criteria when you have ranges like SH420-075:SH450-320.

  5. #5
    Registered User
    Join Date
    02-15-2013
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Trouble Finding Correct Formula to Sort Data

    Craig,

    That does work!! I am not sure why I am having to change the format to text though. I export data out of SAP for use in other sheets that I have created when using the SUMIF and they work fine with the general format. I guess I should have thought to change the formatting myself. Sometimes I guess I have trouble seeingn the forest for the trees. Thanks again for your help!! Always helps to have someone else looking over your shoulder offering up ideas!

    SL

+ 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