减少Excel中的单元格数 [英] Reduce number of cells in Excel

查看:225
本文介绍了减少Excel中的单元格数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个电子表格来管理时区中的组列表。想象下面是单元格:

  0830-0845,Bob Hoskins,Jack Table,Phil Cup 
0845-0900,鲍勃霍斯金斯,杰克表,菲尔杯
0900-0915,鲍勃霍斯金斯,杰克表,菲尔杯
0915-0930,鲍勃霍斯金斯,杰克表,菲尔杯
0930-0945,鲍勃霍斯金斯,Jack Table,Phil Cup
0945-1000,Jane Dunnit,Henry Badass
1000-1015,Jane Dunnit,Henry Badass
1015-1030,Jane Dunnit,Henry Badass
1030 -1045,Terry Turbo
1045-1100,Terry Turbo
1100-1115,Simon Car,Maggie Blah,Jack Paper

在新工作表中,在工作簿中,我可以使用什么类型的公式来将时间段压缩在一起(合并所有值以获得总开始到完成),并生成看起来更多的工作表像这样:

  0830-0945,Bob Hoskins,Jack Table,Phil Cup 
0945-1030,Jane Dunnit, Henry Badass
1030-1100,Terry Turbo
1100-1115,Simon Car,Maggie Blah,Jack Paper

逗号是单元格的墙壁,因此时间戳和名称位于单独的单元格中。这将需要使用公式实现,因为源数据将定期更新

解决方案

部分解决方案相当容易维护使用数据透视表:


  1. 获取开始时间列:

    添加新的列为公式: = VALUE(MID(RC [-4],1,4))

    其中RC [-4]是您的原始时间


  2. 获取结束时间列:

    添加具有公式的新列: = VALUE(MID(RC [-5],6,10))

    其中RC [-5]是您原来的时间范围。


  3. 连接名称列:

    = CONCATENATE(RC [-5],RC [-4] RC [-3])

    其中RC [-5],RC [-4],RC [-3]是名称值的单元格。

    这是用于在数据透视表中进行分组。

    你应该得到这样的东西:


    注意头是重要的! p>


  4. 将新的扩展表的数据透视表插入到新的工作表中:

    将行标签设为名称连接列。

    将开始时间列添加为值,将值字段设置为min
    将结束时间列添加为值,将值字段设置为max

    设置数字格式的最小起始和最大值为'0000',所以它正确显示时间


在可维护性方面:




  • 设置您的数据透视表的动态源范围(相当容易做到)。

  • 通过拖动公式或使用热键更新您的扩展列:ctrl +,ctrl + d来代替。

  • 编写一个非常简单的宏来扩展/更新扩展列。



简化/假设




  • 名称的排序很重要,即不要将名称的集合作为集合



使用excel,我的建议是总是尽可能地利用现有的工具,而不是使用过于复杂的单元格公式,这些公式可能很难调试,而且效率可能不太高。



让我知道这个输出是否有用够了,否则我会看看还能做些什么。


I have a spreadsheet managing a list of groups in time slots. Imagine the below are cells:

0830-0845, Bob Hoskins, Jack Table, Phil Cup
0845-0900, Bob Hoskins, Jack Table, Phil Cup
0900-0915, Bob Hoskins, Jack Table, Phil Cup
0915-0930, Bob Hoskins, Jack Table, Phil Cup
0930-0945, Bob Hoskins, Jack Table, Phil Cup
0945-1000, Jane Dunnit, Henry Badass
1000-1015, Jane Dunnit, Henry Badass
1015-1030, Jane Dunnit, Henry Badass
1030-1045, Terry Turbo
1045-1100, Terry Turbo
1100-1115, Simon Car, Maggie Blah, Jack Paper

In a new sheet, within the workbook, What sort of formula can I use to squash the time slots together (Combine All values to get total Start to Finish) and generate a sheet that looks more like this:

0830-0945, Bob Hoskins, Jack Table, Phil Cup
0945-1030, Jane Dunnit, Henry Badass
1030-1100, Terry Turbo
1100-1115, Simon Car, Maggie Blah, Jack Paper

The commas are the walls of cells, so the timestamps and names are in separate cells. This will need to be achieved using a formula as the source data will be updated regularly

解决方案

Partial solution that is fairly easy to maintain using Pivot tables:

  1. Get start time column:
    Add new column with formula: =VALUE(MID(RC[-4],1,4))
    Where RC[-4] is your original time range.

  2. Get end time column:
    Add new column with formula: =VALUE(MID(RC[-5],6,10))
    Where RC[-5] is your original time range.

  3. Concatenated names column:
    =CONCATENATE(RC[-5],RC[-4],RC[-3])
    Where RC[-5], RC[-4], RC[-3] are the cells with the name values.
    This is for grouping in Pivot Table.
    You should get something like this:
    Note headers are important!

  4. Insert a pivot table with your new extended table into a new worksheet:
    Set row labels to name concatenation column.
    Add start time column as value, with value field setting as min Add end time column as value, with value field setting as max
    Set the number format of min of start and max of end as '0000' so it displays time correctly

In terms of maintainability:

  • Set a dynamic source range for your Pivot table (fairly easy to do).
  • Update your extended columns by dragging formula or using hotkeys: ctrl+, ctrl+d to extend instead.
  • Write a very simple macro to extend/update the extended columns for you.

Simplifications/Assumptions:

  • Ordering of names is significant i.e. do not treat collection of names as a set

With excel, my advice is always to leverage existing tools as much as possible rather than use overly complicated cell formulas which can be hard to debug and possibly less efficient.

Let me know if this output is useful enough otherwise I'll see what else can be done.

这篇关于减少Excel中的单元格数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆