+ Reply to Thread
Results 1 to 11 of 11

Excel 2007 : Largest Variances

Hybrid View

MJDown Largest Variances 11-21-2011, 07:17 AM
Azam Ali Re: Largest Variances 11-21-2011, 07:29 AM
MJDown Re: Largest Variances 11-21-2011, 08:37 AM
Haseeb Avarakkan Re: Largest Variances 11-21-2011, 09:37 PM
MJDown Re: Largest Variances 11-22-2011, 06:12 AM
Haseeb Avarakkan Re: Largest Variances 11-22-2011, 06:26 PM
MJDown Re: Largest Variances 11-24-2011, 06:04 AM
Haseeb Avarakkan Re: Largest Variances 11-24-2011, 01:32 PM
MJDown Re: Largest Variances 11-28-2011, 06:38 AM
Haseeb Avarakkan Re: Largest Variances 11-28-2011, 06:28 PM
MJDown Re: Largest Variances 11-30-2011, 04:25 AM
  1. #1
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Largest Variances

    I have a spreadsheet where I have in column A the following alternatives

    REV
    CST
    OHD

    In column B I have variances against forecast

    In column C What I need to do if list the top 20 variances where column A states "REV". The variances need to be either positive or negative

    In column D I need to to list the top 20 variances regardess if "REV", "CST" or "OHD". Again the varainces are regardless if positive or negative.

    The worksheet comprises over 5000 rows of data

  2. #2
    Valued Forum Contributor
    Join Date
    05-23-2011
    Location
    Lahore PK
    MS-Off Ver
    Excel 2007, 2013
    Posts
    627

    Re: Largest Variances

    in Cell C1, try array formual and confirm with Ctrl+Shift+Enter instead of just enter
    =LARGE(ABS(IF($A$1:$A$5000="REV",$B$1:$B$5000)),ROWS(C$1:C1))

    and in Cell D1, try array formula and confirm with Ctrl+Shift+Enter instead of just enter

    =LARGE(ABS($B$1:$B$5000),ROWS(D$1:D1))

    and copy down
    Azam
    If you want to say Thank you to a member, click the reputation icon (Star) in the left bottom of the post.
    For prompt answer, be descriptive, concise, short, direct, and to-the-point.

  3. #3
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Largest Variances

    Thank you Azam for your help with the array formula. It delivers the numbers that I require but where the variance is a negative variance I need to have the actual number. In the formula above for example it has given me the value of 44917.61 for the 5th largest number. I want the number to appear 5th in the list but to be displayed as (44917.61) as it appears in the source data. I can not use LARGE formula as the top 20 numbers may also include some negative variance so would also need to use the SMALL formula. Can I use if and or functions with this array ?
    Last edited by MJDown; 11-21-2011 at 09:08 AM.

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Largest Variances

    Hello MJDown,

    Try these.

    C2, copy down.

    =IFERROR(INDEX(B$2:B$5000,LOOKUP(9E300,MATCH(({"-",""}&LARGE(ABS(IF(A$2:A$5000="REV",B$2:B$5000)),ROWS(C$2:C2)))+0,B$2:B$5000,0))),"")

    D2, copy down.

    =IFERROR(INDEX(B$2:B$5000,LOOKUP(9E300,MATCH(({"-",""}&LARGE(ABS(B$2:B$5000),ROWS(D$2:D2)))+0,B$2:B$5000,0))),"")

    Both are ARRAY FORMULAS.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Largest Variances

    Thank you Haseeb. I think we are getting there. It is pulling through now both positive and negative values. However it is only showing 8 of the top 20 values when I copy the formula down. The 8 values shown are not the top 8 but in what appear to be random places across the top 20 values. The values that are illustrated are in the correct rankings with blank spaces in the cells where the remainder of the answers should be.This is the case for both formulas. Would you know why this is the case? I have experienced this before when using INDEX and MATCH but in the past have managed to resolve the issue. On this occasion I am having no luck !!
    Last edited by MJDown; 11-22-2011 at 09:36 AM.

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Largest Variances

    If you can attach a sample dummy file, would be helpful. in the bottom click, Go Advanced, then bottom click Manage Attachments & upload your file.

  7. #7
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Largest Variances

    Hi Haseeb

    I have attached some sample data as requested. Thanks for your help, it is truly appreciated !!
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Largest Variances

    Change H2, formula to ,

    =IF($A2="REV",ROUND($B2-C2,2),ROUND($B2-C2,2))

    then copy across & down. This will round the numbers to 2 decimel places.

    See the attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Largest Variances

    Hi Haseeb,

    With your help I am so near to automating my month end reporting now. Can you assist with what will hopefully be the last piece of the jigsaw which I assume may involve an array formula again.

    In column A of the tab entitled "Rec 3QF to Actual Month" I have unique codes that match against column V of the "Data Sheet Mth" worksheet. This should then enable me to write an index and match formula that will extract the variance from column Z of the "Data Sheet Mth" tab and drop it in column I of the "Rec 3QF to Actual Month" tab.

    My problem is I only want to drop in those variances that meet the following two criteria from the "Data Sheet Mth" worksheet. Revenue variance of £10k or more or cost/overheads variances of £5k or more

    Thanks again for your help
    Attached Files Attached Files
    Last edited by MJDown; 11-28-2011 at 06:44 AM.

  10. #10
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Largest Variances

    Try this,

    I8, copy down.

    =SUMIFS('Data Sheet Mth'!Z$3:Z$52,'Data Sheet Mth'!V$3:V$52,A8,'Data Sheet Mth'!$X$3:$X$52,"Rev",'Data Sheet Mth'!Z$3:Z$52,">=10000")+SUM(SUMIFS('Data Sheet Mth'!Z$3:Z$52,'Data Sheet Mth'!V$3:V$52,A8,'Data Sheet Mth'!$X$3:$X$52,{"CST","OHD"},'Data Sheet Mth'!Z$3:Z$52,">=5000"))

  11. #11
    Registered User
    Join Date
    11-21-2011
    Location
    Addlestone, Surrey, UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Largest Variances

    Hi Haseeb,

    Thanks for all your help getting this completed !!!

    Now all I have to do is understand what you have built !! I understand the principle of Index and Match but can you explain the following.

    What does the "lookup(9E300" do ?

+ 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