Forum Discussion

Stefan Giudici's avatar
Stefan Giudici
Copper Contributor
Jan 09, 2018

Include number in sum only if other cell=1

I'm sure this is quite simple but I'm not very experience with excel.

I have many items laid out like below. Each has an option button for a binary choice. Lets say red or blue, and each item has a linked cell off to the right. The end goal is to sum the different other metrics based on red/blue for each product. I can find a formula that says sum these numbers if this cell is 1/2, but what I'm looking for is more like "include this number in sum formula if it's respective linked cell =1"
something like total = if(linkedcell1=1 then include A1) + (if linkedcell2=1 then include A5). So I can get the sum of say our cost or sale price for all items that are red. Can someone help me out? Thanks so much!

3 Replies

  • Stefan Giudici's avatar
    Stefan Giudici
    Copper Contributor
    The link cell is controlled by the radio buttons. I'd like to use this formula multiple times for all the different relevant metrics for the product. Ie, the sum of all red items costs, the sum of all red items revenue, etc. The radio button returns 1 if the product is red, 2 if blue.
    • IngeborgHawighorst's avatar
      IngeborgHawighorst
      MVP

      Please read my other comment again. You did not answer the question I asked there. 


      I do understand that the radio button changes the value of a cell. That's how radio buttons work. 

       

      I need to know where in the spreadsheet the data is that relates to the radio button linked cells. Your screenshot does not show the data to be summed, only the cell with the radio button link. So, where is the data to add up? And how does it relate to the link cell? Is it in the same row? If it is not in the same row, is there a logical position? Like always three rows below the link cell or something like that?

       

  • Hello,

     

    what is the relationship between the linkcell and the cell in column A? Are they on the same row?

     

    If so, you could use a Sumif() or a Sumifs() function, like this (assuming the linkcell values are in column L, change as required)

     

    =Sumifs(A:A,L:L,1)

     

     

Resources