简体   繁体   English

Excel公式计算签入时间

[英]Excel Formula to Calculate Checkin Time

I have a file from restaurant log of 1 month. 我有1个月的餐厅日志文件。 I need to calculate the Checkin Time time from Time and Bill Number column. 我需要从“ TimeBill Number列中计算“ Checkin Time时间。

My Format is: 我的格式是:

Date |Time| TableNumber| Checkin time |Bill Number ..|...|...|  

I can calculate it manually one at a time by copying the 1st data of Time column and copying in Checkin time where bill number is same. 通过复制“ Time列的第1个数据并复制帐单号相同的“ Checkin time ,我可以一次手动计算Checkin time

I have attached a Screenshot of the data. 我已经附上了数据的屏幕截图

Example 1: Blue square 示例1:蓝色方块

Here in the blue square we can see that first value of Time column is 0:02:37 and I have pasted it in Checkin time which has Bill Number 29 . 在蓝色方块中,我们可以看到“ Time列的第一个值为0:02:37 ,我已将其粘贴到具有29 Bill Number 0:02:37Checkin time Bill Number

Example 2: Red square 示例2:红场

First value of Time is 16:08:40 And I have pasted in Checkin time column which have bill number of 1 and so on.. Time第一个值是16:08:40并且我已在“ 16:08:40Checkin time列中粘贴了帐单号为1数字,依此类推。

I did it manually without any equation or formulas. 我是手动完成的,没有任何方程式或公式。 But the problem is the data is of 1 month and I have about 6 to be calculated. 但是问题是数据是1个月,我大约需要计算6个月。


What I tried From the formula given to me by @girlvsdata 我尝试什么 @girlvsdata给我的公式
I tried 我试过了

 =MINIFS(B:B,E:E,E3) 

I did get the data for 1st two unique Bill numbers, but after dragging down the forumla further down, I get different Time for new bill number. 我确实获得了第一个两个唯一帐单号的数据,但是将论坛进一步拉下后,我得到了不同的新帐单号时间。 + as the bill number repeats in further down rows many times, it gives me same time of 1st bill number for repeated bill numbers. +,因为票据编号在下排重复多次,因此我得到了与第一票据编号相同的重复票据编号。 Here is the screenshot of after What I tried Screenshot_after 这是我尝试过之后的屏幕截图

If you have the latest version of Excel, you can use =MINIFS() to find the first Time for that particular Bill Number (the Checkin time ). 如果您具有最新版本的Excel,则可以使用=MINIFS()查找该特定Bill Number的首次使用Time (“ Checkin time )。

In cell D3 enter this formula: 在单元格D3输入以下公式:

=MINIFS(B:B,E:E,E3)

Make sure that the cell has Time formatting for it to show correctly. 确保该单元格具有“ Time格式才能正确显示。

So if i'm reading this correct you want to correspond the 'checkin time' with the first occurence of its bill number's 'time'? 因此,如果我阅读的是正确的字词,那么您想将“签到时间”与其账单号的“时间”首次出现相对应吗?

You should use a formula in D2 like: 您应该在D2使用以下公式:

=INDEX($B$2:$B$1000,MATCH(TRUE,EXACT(E2,$E$2:$E$1000),0))

Confirm with Ctrl + Shift + Enter and drag down your formula 使用Ctrl + Shift + Enter确认并向下拖动公式

Note: Change $B$1000 and $E$1000 to whichever rownumber your sheets ends 注意:将$B$1000$E$1000更改$B$1000表结尾的行号

EDIT 1 编辑1

Here is an example of how this would work; 这是一个如何工作的例子。

在此处输入图片说明

EDIT 2 编辑2

Here is how it worked for me in your data: 在您的数据中,这对我有用:

在此处输入图片说明

I propose the following: 我提出以下建议:

=IF(AND(E3=E1,C3=C1,A3=A1),D1,MIN(OFFSET(E3,0,-3,MATCH(0,(E3:E$18=E3)*(C3:C$18=C3)*(A3:A$18=A3),0)-1,1)))

It is a bit long and will likely take a while to calculate if you have lots of rows. 它有点长,如果有很多行,可能要花一些时间来计算。 The above formula is to be entered as an array formula, ie copy/type the formula then instead of pressing Enter, use Ctrl+Shift+Enter. 上面的公式将作为数组公式输入,即复制/键入公式,然后使用Ctrl + Shift + Enter代替Enter。 If you do it right, excel will insert {} around it like in the screen shot below: 如果操作正确,excel将在其周围插入{} ,如以下屏幕截图所示:

在此处输入图片说明

Change the ranges E3:E$18 , C3:C$18 and A3:A$18 accordingly and notice that they are all one row below the end of the table (otherwise you get #N/A for the last bill). 更改范围E3:E$18C3:C$18A3:A$18 。因此,请注意,他们是表的末尾(否则你会得到下面的所有一行#N/A最后法案)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM