+ Reply to Thread
Results 1 to 21 of 21

Lower sales by store

  1. #1
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Lower sales by store

    I have an excel sheet where there are many formulas and a column with values and another with the code of the store. With dynamic tables the file is very large (68MB) the book will contain every month and fill up as time passes.

    With a formula you could do the same?

    They ask me to take the top of the 4 worst sales per store. I include a part of the table with what is currently and Top sheet January where you should see 2 tables of the worst 4 sales of the last 2 months, the same should be done next month.


    Thanks for helping
    Attached Files Attached Files
    Last edited by pl123zorro; 07-24-2017 at 12:56 PM. Reason: AliGW

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Top 4 More bad sales for Cod

    Assuming stores are listed:

    in K5

    =IFERROR(SMALL(IF($A$2:$A$100=I5,$C$2:$C$100),COUNTIF($I$5:I5,I5)),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    in J5

    =IFERROR(INDEX($B$2:$B$100,MATCH(K5,$C$2:$C$100,0)),"")

    P.S.: Please change your thread title (or I'll be in trouble!) ... Forum Rule

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Last edited by JohnTopley; 07-22-2017 at 04:31 PM.

  3. #3
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Top 4 More bad sales for Cod

    Thanks JohnTopley did not understand it first you are looking for sales and then the seller, use it and it works very well
    In the same way would be done for the best 4 but using Large.

    I have to see if the size is reduced Now File Type: xlsx DATA1SALES.xlsx‎ (16.1 KB) File Type: xlsx DATA1SALES(2).xlsx‎ (13.4 KB) >>>>3.3KB
    Attached Files Attached Files
    Last edited by pl123zorro; 07-22-2017 at 05:01 PM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Top 4 More bad sales for Cod

    In "Top January"

    in D2

    =IFERROR(LARGE(IF(January!$A$2:$A$100=B2,January!$C$2:$C$100),COUNTIF($B$2:B2,B2)),"")

    =IFERROR(INDEX(January!$B$2:$B$100,MATCH(D2,January!$C$2:$C$100,0)),"")...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    in C2

    =IFERROR(INDEX(January!$B$2:$B$100,MATCH(D3,January!$C$2:$C$100,0)),"")
    Last edited by FDibbins; 07-23-2017 at 01:46 AM. Reason: John replied before the change request was made

  5. #5
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Top 4 More bad sales for Cod

    The company in which I work has several stores identified with codes and requires seeing the 4 lowest sales, which helped me work but in case there are equal values the formula can not find them. Pivot tables in this case have too many MBs.
    Attached Files Attached Files
    Last edited by pl123zorro; 07-24-2017 at 12:57 PM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    In J2

    =IFERROR(INDEX($B$2:$B$58,SMALL(IF(($A$2:$A$58=$I5)*($C$2:$C$58=$K5),ROW($B$2:$B$58)-ROW($B$2)+1,""),COUNTIFS($K$5:$K5,$K5,$I$5:$I5,$I5))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  7. #7
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Lower sales by store

    It does not give me any results, which I do wrong
    Thank you
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    because you have not placed the original formula in column K !!
    Attached Files Attached Files
    Last edited by JohnTopley; 07-24-2017 at 03:31 PM.

  9. #9
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Lower sales by store

    Since I can not make the 4 in red in that column and I will be ready with your help.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    Explain to me how you expect 4 (or more) results when there are only 3 "180" stores in the table????

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Lower sales by store

    Edit Mistakes in final formula. See post #15 below.

    ... dynamic tables the file is very large (68MB)
    This caught my eye.

    Just in case array formulas begin to slow the workbook down would you be interested in a (rather lengthy) non array approach?

    This solution requires:
    1. The source table to be sorted on Cod store.
      (I inserted a sort key in a new column A in case you need to recover the original data order.)
    2. A lookup table in K:M that returns the lower and upper row boundaries of each Cod store group.

    Copy and paste the Cod stores in column K. Remove duplicates. Then in L2:M8 this formula to set the boundaries.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then in H5:I32
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by FlameRetired; 07-27-2017 at 12:19 AM.
    Dave

  12. #12
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Lower sales by store

    1) Change the PivotTable [Report Layout] to [Show in Tabular Form]
    2) Sort the Name column in ascending Sales Order under [More Sort Options]
    3) Add in a [Calculated Field] with the formula "=COUNT('Cod Store' )"
    4) Click on [Show Values As] and select [Running Total in] with Name as the [Base Field]
    5) Filter the Rank column to show only the first 4 items
    6) When the database is updated, refresh the PivotTable and do the filtering in Rank column again
    Attached Files Attached Files
    Last edited by josephteh; 07-26-2017 at 11:35 PM.

  13. #13
    Registered User
    Join Date
    11-25-2012
    Location
    hk
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Lower sales by store

    Quote Originally Posted by josephteh View Post
    1) Change the PivotTable [Report Layout] to [Show in Tabular Form]
    2) Sort the Name column in ascending Sales Order under [More Sort Options]
    3) Add in a [Calculated Field] with the formula "=COUNT('Cod Store' )"
    4) Click on [Show Values As] and select [Running Total in] with Name as the [Base Field]
    5) Filter the Rank column to show only the first 4 items
    6) When the database is updated, refresh the PivotTable and do the filtering in Rank column again
    quote insights from josephteh....
    the bottom 4 filter in pivot should be able to help.
    to use bottom 4 fliter,
    1) go to the pivot created
    2)go to the drop down box on Name
    3) select Value filters then top 10 filter
    4) change Top drop down to bottom
    5) change 10 to 4
    see attached.
    Last edited by teireii; 07-26-2017 at 11:56 PM.

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Lower sales by store

    Mistake(s) in final formula post #12.

    Need two. In H5:H32.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In I5:I32
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    My apologies.
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Lower sales by store

    Quote Originally Posted by teireii View Post
    quote insights from josephteh....
    the bottom 4 filter in pivot should be able to help.
    to use bottom 4 fliter,
    1) go to the pivot created
    2)go to the drop down box on Name
    3) select Value filters then top 10 filter
    4) change Top drop down to bottom
    5) change 10 to 4
    see attached.
    I added the extra Rank column to take care of repeat items... as you can see in Cod Store 120 there are 5 names displayed because Brenda and Andrew have the same lowest sales of 780. And in Cod Store 170 7 names are displayed.

  16. #16
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Lower sales by store

    Maybe we should just stick to the Top 4 and delete the extra Rank column because as in Cod Store 170, 3 other names also shared the same low spots and my results only mentioned 1 of the 4 names.

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    Another option (see Sheet "Sort_with_Helper") to avoid array formulae: as pointed previously these formula could adversely impact performance in such a large file (^8MB)

    Custom Sort by Store code then Sales amount (both Smallest to Largest): this gives one ranking

    To then get Largest to Smallest (Table in F:I)

    in I2:

    =IFERROR(INDEX($C$2:$C$100,MATCH($G2&COUNTIFS($A:$A,$G2)-$F2+1,$D$2:$D$100,0)),"")

    Copy down

    in H2

    =IFERROR(INDEX($B$2:$B$100,MATCH($G2&COUNTIFS($A:$A,$G2)-$F2+1,$D$2:$D$100,0)),"")
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Lower sales by store

    I explain my problem although it is almost ready:
    I have a book that each month is added a sheet corresponding to that new month that can have up to 35000 rows with the number that identifies each store and sales of each employee. Each month you create a sheet called Top (To see the 4 lowest sales for each store and one that shows the same of the previous month, these two tables are created with dynamic tables).
    Each leaf per month has many columns and formulas. The management requires to have 2 tables that allow to see the 4 lowest sales of the last 2 months, but they do not allow that we eliminate those of the previous months.
    This causes the files to occupy many MB.
    Additionally we found that the PivotTable shows 4 people or 5 that have equal values, but when
    Position 1 is 50, Position 2 is 65 and there are 2 more with 65 me shows them, Position 3 is 70 and there are 3 with that value shows them but for Position 4 it no longer shows anything, so in the table DATA1SALES (6) .xlsx leave the dynamic table and the numbers from 1 to 4 that indicate the position.

    I have never had such a problem with Excel, but it is the requirements of the management of the company.

    I'm trying everything they sent me, but the idea is not to use PivotTable for now.

    Thanks everyone for your help

  19. #19
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    None of the solutions I offered uses Pivot tables: they are based on the data in columns A:C.

    So do you need further help?

  20. #20
    Registered User
    Join Date
    06-18-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Lower sales by store

    Thank you all for your help with the functions I was given and other more reduced file size (less MB).

    I have one file that uses PivotTable and one that has less MB using only functions.

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Lower sales by store

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vlookup to pull in sales data based on the month sales begins
    By adam_d_john in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-12-2017, 05:07 PM
  2. Replies: 2
    Last Post: 09-11-2015, 07:13 AM
  3. Replies: 1
    Last Post: 06-09-2015, 09:30 AM
  4. Replies: 1
    Last Post: 11-19-2013, 12:52 PM
  5. Replies: 6
    Last Post: 10-19-2013, 04:53 PM
  6. Replies: 7
    Last Post: 07-23-2013, 07:56 AM
  7. Replies: 2
    Last Post: 06-19-2012, 10:19 AM

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