+ Reply to Thread
Results 1 to 6 of 6

Calculate based on two columns

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Calculate based on two columns

    Hi,

    I am trying to use column A and Column B in the following example file and based on those two calculate on Column C

    So for example, I do a VAR calculation for Location IDs 19 which fall in Store # xxxx.

    I tried to use a pivot table, but I need to then perform calculations based on the var calc and pivot tables don't provide that functionality ( I could be totally wrong). So for example, if the variance on Location ID 19 within store # xxxx is 0, then I know it's consistent and I want to say that Store # xxxx is consistent, or inconsistent.

    If any of this doesn't make sense please forgive me, and I will clarify.

    Thanks in advance for your help.

    Excel Example for Question.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: Calculate based on two columns

    I do not understand what you are trying to do.

  3. #3
    Registered User
    Join Date
    03-15-2012
    Location
    NM, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Calculate based on two columns

    What is it that you are trying to calculate? I'm really confused by what you are trying to do.

  4. #4
    Registered User
    Join Date
    03-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3
    Any calculations other then sumif really. Basically if store # is x and location id is y, var on all column c items that fit into this categpry

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate based on two columns

    Perhaps try this array formula in D2

    =VAR(IF(A$2:A$28=A2,IF(B$2:B$28=B2,C$2:C$28)))

    confirmed with CTRL+SHIFT+ENTER and copied down

    ...or this variation will only give you a result on the first instance of each Store/Location combination

    =IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2)=1,VAR(IF(A$2:A$28=A2,IF(B$2:B$28=B2,C$2:C$28))),"")
    Audere est facere

  6. #6
    Registered User
    Join Date
    03-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Calculate based on two columns

    Awesome, thank you for your help daddylonglegs, but how do I change the result so that instead of a var over the entire column on the first instance of each store/location combo, I only get the var for the part of the column that the store/location combo applies to?

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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