Excel - 根据下拉选择汇总连续值

时间:2015-07-03 04:24:23

标签: excel excel-formula

我有像

这样的值
    function drawSalesGraph()
{
    if (sales_data_graph.length > 1)
    {
        graph_height = 500;
        var options_graph = {
            width: '1200',
            height:graph_height,
            colors: ['#ea6f09','#fb250d', '#0ac9c6', '#2680be', '#575bee','#6bd962','#ff0000','#000000'],
            fontSize : 10,
            pointSize : 10,
            legend: {'position': 'right'}
        };
        var data = new google.visualization.arrayToDataTable(sales_data_graph);
        $('#graph_sales_data').show();
    }
    else
    {
        var data = new google.visualization.DataTable();
        $('#graph_sales_data').hide();
    }
    // Create and draw the visualization.
    chart = new google.visualization.AreaChart(document.getElementById('graph_sales_data'));
    chart.draw(data, options_graph);
}

我有选择月份的下拉菜单  如果用户拿到了2月的月份  那么总和应该显示为30

帮帮我吧!尝试了很多excel功能最终导致沮丧

1 个答案:

答案 0 :(得分:1)

非常有趣的想法。

enter image description here

B1 =SUM(INDIRECT("E1:E"&MATCH(A1,D:D,0)))

中的公式

希望这会对你有所帮助。

A B C D E Feb 30 Month Price Jan 10 Feb 20 Mar 30 Apr 40 May 50 Jun 60 Jul 70 Aug 80 Sep 90 Oct 100 Nov 110 Dec 120