Mark combined if.......

mark692

Active Member
Joined
Feb 27, 2015
Messages
321
Office Version
  1. 2016
Platform
  1. Windows
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Group Code[/TD]
[TD]Remarks[/TD]
[/TR]
[TR]
[TD]06/02/2017[/TD]
[TD]1[/TD]
[TD]combined[/TD]
[/TR]
[TR]
[TD]01/01/2018[/TD]
[TD]1[/TD]
[TD]combined[/TD]
[/TR]
[TR]
[TD]03/02/2018[/TD]
[TD]1[/TD]
[TD]combined[/TD]
[/TR]
[TR]
[TD]01/05/2017[/TD]
[TD]2[/TD]
[TD]nope[/TD]
[/TR]
[TR]
[TD]01/06/2017[/TD]
[TD]2[/TD]
[TD]nope[/TD]
[/TR]
[TR]
[TD]01/08/2018[/TD]
[TD]3[/TD]
[TD]combined[/TD]
[/TR]
[TR]
[TD]09/09/2017[/TD]
[TD]3[/TD]
[TD]combined[/TD]
[/TR]
</tbody>[/TABLE]


hi guys is this possible,

if the year of dates within the same group is different i want to put "combined" in remarks column, if not put "nope"?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi, here is one option that you can try:


Excel 2013/2016
ABC
1DateGroup CodeRemarks
206/02/20171Combined
301/01/20181Combined
403/02/20181Combined
501/05/20172Nope
601/06/20172Nope
701/08/20183Combined
809/09/20173Combined
Sheet1
Cell Formulas
RangeFormula
C2=IF(COUNTIFS($A$2:$A$8,">="&DATE(YEAR(A2),1,1),$A$2:$A$8,"<="&DATE(YEAR(A2),12,31),$B$2:$B$8,B2)=COUNTIFS($B$2:$B$8,B2),"Nope","Combined")
 
Upvote 0
thanks sir your formula work but the problem occur when table is like this


Excel 2013/2016
ABC
dategroup coderemarks
nope
nope
nope
combined
combined
combined

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]01/01/2017[/TD]
[TD="align: right"]1[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]01/02/2017[/TD]
[TD="align: right"]1[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]02/02/2017[/TD]
[TD="align: right"]2[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]02/18/2018[/TD]
[TD="align: right"]2[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]

</tbody>
Sheet1



a cell on column A has no data but within group code
 
Last edited:
Upvote 0
problem occur when table is like this

Hi, I guess you you forgot to tell us that was a possibility, here is one option - pay attention to the array formula notes.


Excel 2013/2016
ABC
1DateGroup CodeRemarks
201/01/20171Nope
301/02/20171Nope
41Nope
501/05/20172Combined
601/06/20182Combined
72Combined
Sheet1
Cell Formulas
RangeFormula
C2{=IF(SUM(0+(FREQUENCY(IF($B$2:$B$7=B2,IF(ISNUMBER($A$2:$A$7),YEAR($A$2:$A$7))),YEAR($A$2:$A$7))>0))=1,"Nope","Combined")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
thanks again sir your array formula work but can i add another column that will show me the year? like this


Excel 2013/2016
ABCD
1DateGroup CodeRemarksYear
201/01/20171Nope2017
301/02/20171Nope2017
41Nope2017
501/05/20172Combined2017, 2018
601/06/20182Combined2017, 2018
72Combined2017, 2018
Sheet1
 
Upvote 0
can i add another column that will show me the year?

Hi, I don't think it will be easy to list the years in the same cell without using VBA of some sort, maybe in the form of a UDF or we could probably list the years in seperate cells (like below) if VBA is not option.

What are your thoughts?


Excel 2013/2016
ABCDEF
1DateGroup CodeRemarksYears..
201/01/20171Nope2017
301/02/20171Nope2017
41Nope2017
501/05/20172Combined201720182019
601/06/20182Combined201720182019
701/06/20162Combined201720182019
82Combined201720182019
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top