+ Reply to Thread
Results 1 to 6 of 6

SUMPRODUCT Conditional Formatting

Hybrid View

  1. #1
    Registered User
    Join Date
    11-01-2018
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    SUMPRODUCT Conditional Formatting

    Hello all,

    Attempting to write a weighted average with multiple conditions. Having trouble with multiple aspects of the formula.

    1)Instead of being equal too text (e.g. --(F:F="Apples") I attempted wrote my formula as you would to be NOT equal to the text (e.g --(F:F<>"Oranges")). This is because there are multiple unique variables which exist in my data so it is easier to just exclude "Apples". I could manipulate the data so that these multiple variables all roll up to one unique variable "NOT APPLES", but would prefer to keep the current structure.

    2)One Condition I wrote is greater than a date. It is linked to a cell but I attempted to write this as you would for an IF Condition (E:E>=&A1)

    This could be a simple quotation mark or other formatting error. Finding information on this specific situation was difficult. Any help is greatly appreciated Actual Formula I used is below:

    =SUMPRODUCT(--('Loan Level Data Query'!$B:$B='Lookup Logic'!B1),--('Loan Level Data Query'!$L:$L>='Lookup Logic'!B2),--('Loan Level Data Query'!$E:$E<>"Conventional"),--('Loan Level Data Query'!$J:$J<>"Corespond"),('Loan Level Data Query'!$D:$D,'Loan Level Data Query'!$F:$F))/SUM('Loan Level Data Query'!$D:$D)
    Last edited by Cstrauss; 11-01-2018 at 02:14 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,802

    Re: SUMPRODUCT Conditional Formatting

    Welcome to the Forum Cstrauss!

    I do not see anything logically or syntactically wrong with your formula based just on what you described. Yet it still might not be the right formula, depending on what your data looks like.

    I do see one little hiccup. Please check your data to see if column J of sheet Loan Level Data Query has any values that say "Corespond". This is a spelling error and maybe your formula should say "Correspond".

    If that is not your problem then it will help to attach your file. The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-01-2018
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    Re: SUMPRODUCT Conditional Formatting

    File is attached. expected outcome is 697.8
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,802

    Re: SUMPRODUCT Conditional Formatting

    How did you determine what the answer should be? This is how your formula breaks down.

    =SUMPRODUCT(

    --('Loan Level Data Query'!$B:$B='Lookup Logic'!B1), OK

    --('Loan Level Data Query'!$L:$L>='Lookup Logic'!B2), OK

    --('Loan Level Data Query'!$E:$E<>"Conventional"), OK

    --('Loan Level Data Query'!$J:$J<>"Correspond"), OK (updated; see note in my next post)

    ('Loan Level Data Query'!$D:$D,'Loan Level Data Query'!$F:$F) I don't understand what you're trying to do with this last part, this may be causing the error

    )

    /SUM('Loan Level Data Query'!$D:$D) Assuming you really want to divide by the sum of all loans in the entire list to get a percentage or something.


    I just noticed your title--your post doesn't seem to have anything to do with conditional formatting. Please consider revising the title.
    Last edited by 6StringJazzer; 11-01-2018 at 06:19 PM.

  5. #5
    Registered User
    Join Date
    11-01-2018
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    Re: SUMPRODUCT Conditional Formatting

    Using filters I moved all of the relevant data onto a new tab then did a weighted avg using SUMPRODUCT('Loan Level Data Query'!$D:$D,'Loan Level Data Query'!$F:$F)/SUM('Loan Level Data Query'!$D:$D). If it is that last part which is causing the error what would you suggest? You do bring up a good point, The Denominator should be SUMIFS('Loan Level Data Query'!$D:$D,'Loan Level Data Query'!$E:$E,"<>Conventional",'Loan Level Data Query'!$J:$J,"<>Correspond",'Loan Level Data Query'!$B:$B,'Lookup Logic'!B1,'Loan Level Data Query'!$L:$L,">="&'Lookup Logic'!B2)as I don't want to divide by the sum of the entire population of loans for the weighted average, just the sample with conditions

    I apologize for the title, essentially I'm trying to use these conditions and the SUMPRODUCT function to get a weighted average.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,802

    Re: SUMPRODUCT Conditional Formatting

    First I made an error in my analysis above. I overlooked that you are looking for <>"Correspond", so it should include all values.

    Your last post cleared up a lot of my questions.

    Phew! So this formula gives your expected result:

    =SUMPRODUCT(--('Loan Level Data Query'!$B:$B='Lookup Logic'!B1),--('Loan Level Data Query'!$L:$L>='Lookup Logic'!B2),--('Loan Level Data Query'!$E:$E<>"Conventional"),--('Loan Level Data Query'!$J:$J<>"Correspond"),'Loan Level Data Query'!$D:$D,'Loan Level Data Query'!$F:$F)/SUMPRODUCT(--('Loan Level Data Query'!$B:$B='Lookup Logic'!B1),--('Loan Level Data Query'!$L:$L>='Lookup Logic'!B2),--('Loan Level Data Query'!$E:$E<>"Conventional"),--('Loan Level Data Query'!$J:$J<>"Correspond"),'Loan Level Data Query'!$D:$D)

+ 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] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  2. Conditional Formatting - 2 sheets using Vlookup or Index/Match or SumProduct?
    By phrankndonna in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2016, 01:38 PM
  3. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  4. [SOLVED] Conditional formatting: SUMPRODUCT over range - delete rows
    By ExcelStefan in forum Excel General
    Replies: 3
    Last Post: 07-23-2012, 04:35 AM
  5. Conditional Formatting calander with SUMPRODUCT
    By dudelebowski in forum Excel General
    Replies: 3
    Last Post: 11-17-2010, 05:54 PM
  6. Replies: 3
    Last Post: 07-09-2009, 08:22 AM
  7. sumproduct and conditional formatting problem
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-11-2008, 11:22 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