计数加上日期范围?
你好,
我的表格上有一栏写着每年的截止日期。我想计算一下每个月有多少到期,以便在预测报告中显示1月到期#,2月到期#,等等。
我如何写日期的公式,使它包括每个月的所有日子?
=Countifs[调整的截止日期]:[调整的截止日期],date >= 1月1日,[调整的截止日期]:[调整的截止日期],date <= 1月31日
unparseable。
谢谢你的时间和帮助。
卡罗尔
最佳答案
-
希瑟·达夫 ✭✭✭✭✭✭
与日期单元格一起使用时,IFERROR函数有助于忽略空白。(这是对它的一种过于简化的解释,但它适用于周一早上。)例如,IFERROR(MONTH(@cell),0)=1表示查看单元格中的月份是否为1月,但如果有错误(这发生在不是日期的单元格中-没有月份要查找),则不计算它。
让我们试试这个:
=条件统计年代([调整到期日]:[调整到期日],IFERROR(MONTH(@cell), 0) = 1,[调整到期日]:[调整到期日],IFERROR(YEAR(@cell), 0) = YEAR(TODAY()), [其他列]: [其他列),而不是(包含(”ABCD EFG”,@cell)))
当然,您需要将“Other column”文本替换为上述其他列的实际名称,并将“ABCD EFG”替换为您不希望包含的实际文本。
让我知道它是否有效!
答案
-
希瑟·达夫 ✭✭✭✭✭✭
试试这个:
=COUNTIF([调整到期日]:[调整到期日],IFERROR(MONTH(@cell), 0) = 1)
这是一月份的数据;然后,对于其余部分,您可以将MONTH(@cell)= number调整为2表示2月,3表示3月,等等。
希望这对你有帮助!如果对你有用,请告诉我。
最好的
希瑟
-
卡罗尔墙 ✭
谢谢@Heather达夫!
是的,这是有效的!这正是我想要的。
但现在我意识到,在今年的预测中,我需要排除2023年的一些日期。那么我该如何安排免赔年呢?
=COUNTIF([调整到期日]:[调整到期日],IFERROR(MONTH(@cell), 0,((电子邮件保护)),0) = 1)
没有解析悲伤。恐怕我不熟悉If Error功能。
此外,我需要排除在另一列中包含单词“ABCD EFG”的某些行。
是否有可能把这个排除在外?
再谢谢你!
卡罗尔
-
希瑟·达夫 ✭✭✭✭✭✭
与日期单元格一起使用时,IFERROR函数有助于忽略空白。(这是对它的一种过于简化的解释,但它适用于周一早上。)例如,IFERROR(MONTH(@cell),0)=1表示查看单元格中的月份是否为1月,但如果有错误(这发生在不是日期的单元格中-没有月份要查找),则不计算它。
让我们试试这个:
=条件统计年代([调整到期日]:[调整到期日],IFERROR(MONTH(@cell), 0) = 1,[调整到期日]:[调整到期日],IFERROR(YEAR(@cell), 0) = YEAR(TODAY()), [其他列]: [其他列),而不是(包含(”ABCD EFG”,@cell)))
当然,您需要将“Other column”文本替换为上述其他列的实际名称,并将“ABCD EFG”替换为您不希望包含的实际文本。
让我知道它是否有效!
-
卡罗尔墙 ✭
谢谢你周一早上的帮助!
我有一年的工作时间,但没有被排除在其他专栏之外。既然我有了更好的理解,我就摆弄一下。谢谢你的帮助。
帮助文章参考资料欧宝体育app官方888
类别
=IF(OR(Status@row = \"Complete\", Status@row = \"Canceled\", AND(Status@row = \"In Progress\", End@row>= TODAY())), \"Green\", IF(OR(AND(Status@row = \"In Progress\", End@row<= TODAY(-2)), AND(Status@row = \"Not Started\", Start@row<= TODAY(-2))), \"Red\", \"Yellow\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2023-01-13 15:39:50","updateUser":{"userID":156761,"name":"Indiemusicboy","url":"https:\/\/community.smartsheet.com\/profile\/Indiemusicboy","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-01-15T00:02:15+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":99683,"type":"question","name":"Formula with IF, AND, CONTAINS","excerpt":"I need a formula that generates a different price depending on which options have been selected in two different columns. In one column I'm using the word premium to differentiate between the options (whether or not the text contains \"premium\" - because there are other options in the dropdown that do not contain…","categoryID":322,"dateInserted":"2023-01-13T18:13:16+00:00","dateUpdated":null,"dateLastComment":"2023-01-13T21:55:08+00:00","insertUserID":156854,"insertUser":{"userID":156854,"name":"Alyce R.","url":"https:\/\/community.smartsheet.com\/profile\/Alyce%20R.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-01-13T22:37:29+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-01-13T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":10,"countViews":43,"score":null,"hot":3347286504,"url":"https:\/\/community.smartsheet.com\/discussion\/99683\/formula-with-if-and-contains","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/99683\/formula-with-if-and-contains","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":99683,"commentID":357172,"name":"Re: Formula with IF, AND, CONTAINS","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/357172#Comment_357172","dateInserted":"2023-01-13T21:55:08+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-01-13T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-01-13T20:28:39+00:00","dateAnswered":"2023-01-13T19:36:51+00:00","acceptedAnswers":[{"commentID":357139,"body":"
Formulas don't always scale very well which is why I suggested a reference table. If you would prefer to work with a formula, then you would use something like this for the example in your original post:<\/p>
=IF(CONTAINS(\"Premium\", [Which newsletter?]@row), IF(CONTAINS(\"Spotlight\", Placement@row), \"1000\", \"900\"), IF(CONTAINS(\"Spotlight\", Placement@row), \"800\", \"700\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2023-01-13 20:28:39","updateUser":{"userID":156854,"name":"Alyce R.","url":"https:\/\/community.smartsheet.com\/profile\/Alyce%20R.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-01-13T22:37:29+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":99675,"type":"question","name":"Tracking the cumulative days of a cell value change","excerpt":"I need to create column where i can track a number of days a column is checked. in my sheet, there is a check box field for Active status and another column named Active days. when the active status is checked, then it should record the number of days it is checked in the active days column. when someone unchecks it, the…","categoryID":322,"dateInserted":"2023-01-13T15:52:45+00:00","dateUpdated":"2023-01-13T15:54:51+00:00","dateLastComment":"2023-01-13T21:49:23+00:00","insertUserID":120420,"insertUser":{"userID":120420,"name":"asish lamichhane","url":"https:\/\/community.smartsheet.com\/profile\/asish%20lamichhane","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-01-13T20:26:15+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"updateUserID":120420,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-01-13T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":5,"countViews":33,"score":null,"hot":3347274728,"url":"https:\/\/community.smartsheet.com\/discussion\/99675\/tracking-the-cumulative-days-of-a-cell-value-change","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/99675\/tracking-the-cumulative-days-of-a-cell-value-change","format":"Rich","lastPost":{"discussionID":99675,"commentID":357169,"name":"Re: Tracking the cumulative days of a cell value change","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/357169#Comment_357169","dateInserted":"2023-01-13T21:49:23+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-01-13T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-01-13T20:26:13+00:00","dateAnswered":"2023-01-13T19:17:57+00:00","acceptedAnswers":[{"commentID":357132,"body":"
Sorry about that. I misunderstood the first time I read.<\/p>
<\/p>
You will need to set up the date checked column, and you will also need to set up a second sheet as a recipient for a copy row automation that copies when the box is unchecked. This will capture the static data on the second sheet for how many days the box was checked before it was again unchecked. You will also need a unique identifier on each row (Auto-Number column).<\/p>
Then the formula would be<\/p>
=SUMIFS({Static Sheet Days Checked Column}, {Static Sheet Unique ID Column}, @cell = [Unique ID]@row) + IF([Checkbox Column]@row = 1, TODAY() - [Checked Date]@row, 0)<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2023-01-13 20:26:11","updateUser":{"userID":120420,"name":"asish lamichhane","url":"https:\/\/community.smartsheet.com\/profile\/asish%20lamichhane","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-01-13T20:26:15+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">