ot: please, math help? stacking percentage to 100%?

MistaraMistara Posts: 38,675

i'm working on a spreadsheet. laugh

y'know the chart type: stacking to a 100%

trying to put a calculation in a cell to get the same percent.  >.< crying

have no idea how to make the 2 ytd values, stack to a 100 percents math

225.4 ---> 51.9%

help!!!

Thanks!!!

percent stack.jpg
695 x 614 - 66K

Comments

  • Do you just need to do this for two columns? Like, in your example you need the cell you are pointing at to be based on columns B and C (guessing at the columns, not sure if the black bar is formatting or a column is used).

    And I'm assuming this is Excel. You should be able to just use a formula like =B14/SUM($B14:$C14) assuming that is row 14. Format the cell as a percent and you can copy the formula to other rows and columns and it should update correctly. If you are doing this for more than two columns, update the SUM to include all the values you want included.

    And if I'm misunderstanding what you need for this, let me know smiley .

  • MistaraMistara Posts: 38,675

    Do you just need to do this for two columns? Like, in your example you need the cell you are pointing at to be based on columns B and C (guessing at the columns, not sure if the black bar is formatting or a column is used).

    And I'm assuming this is Excel. You should be able to just use a formula like =B14/SUM($B14:$C14) assuming that is row 14. Format the cell as a percent and you can copy the formula to other rows and columns and it should update correctly. If you are doing this for more than two columns, update the SUM to include all the values you want included.

    And if I'm misunderstanding what you need for this, let me know smiley .

     

    Thanks.  Works brilliant.

    except when sum = 0, >.<  guess i need a bunch of if statements

    i'm working in google spreadsheets, there doesn't seem to way to make the data series in chart to show the values in percentages. 

    some excel stuff doesn't port over to google and vice versa.
    it's nightmare to maintain spreadsheets in both. 
    have to be honest though, google shared drive is nicer to work with than MS Sharepoint.

  • AlmightyQUESTAlmightyQUEST Posts: 1,999
    edited December 2017

    Hm, I'll try to take a look at google spreadsheets at some point today about the value display.

    And you are right, I hadn't considered that, but just doing =IF(SUM($B14:$C14)>0,B14/SUM($B14:$C14),NULL) should do it. I am almost 100% sure there is a slightly easier way to check that in Excel but don't remember it off the top of my head.

    *That first one did assume there wouldn't be negative values, but if that is possible, change the > to = and flip the other two sections and it should also work.

    Post edited by AlmightyQUEST on
  • MistaraMistara Posts: 38,675

    not sure about ezcel.  access has Nz() function.

     

Sign In or Register to comment.