IF Statement Help Please :)

jeffj13

New Member
Joined
Jun 25, 2015
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hello, appreciate any help provided!

I want to create a statement that returns a yes or no response if certain criteria are met in another column. However, I want to only apply this argument within the same cell values of the corresponding ID. For the example below, for ID 123 I want to check if both "DI" and "OL" exist in the service code column. But I only want to check this for 123 and for the formula to switch the test for 456. I would like it to return no if " DI" and "OL" are present and yes if only "DI" is present. Not sure how to apply this to only the same ID in the first column without crossing over into the next ID. I should also add that the ID's are completely random and I never know exactly what numbers will be used.

IDService Code
123RE
123DI
123OL
456RE
456DI
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
What should be returned if neither value are present?
Also what should be returned if only OL exists?
 
Upvote 0
What should be returned if neither value are present?
Also what should be returned if only OL exists?
Sorry for leaving that out. IF "RE" and "DI" then no. If only "DI" then yes. Any other condition outside of those two would be no. I added "OL" as an example, however it could be another 2 digit alpha character. Hopefully that makes sense.
 
Upvote 0
Thanks for that, I also forgot to ask what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that, I also forgot to ask what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
I am using Excel 2016 and I added that to my account details, thanks!
 
Upvote 0
Thanks for that.
How about
+Fluff 1.xlsm
ABC
1IDService Code
2123REno
3123DIno
4123OLno
5456OLyes
6456DIyes
7789OLno
8789REno
9789ABno
10
Data
Cell Formulas
RangeFormula
C2:C9C2=IF(COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,"DI"),IF(COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,"RE"),"no","yes"),"no")
 
Upvote 0
Solution
If it doesnt matter what the other two digit code is but only that another exists then you could go:

=IF(COUNTIFS(A:A,A2,B:B,"DI")=COUNTIFS(A:A,A2),"Yes","No")
 
Upvote 0
Thanks for that.
How about
+Fluff 1.xlsm
ABC
1IDService Code
2123REno
3123DIno
4123OLno
5456OLyes
6456DIyes
7789OLno
8789REno
9789ABno
10
Data
Cell Formulas
RangeFormula
C2:C9C2=IF(COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,"DI"),IF(COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,"RE"),"no","yes"),"no")
Thank you both, this worked!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Weird. Not sure it works regarding the opening post and post number 3.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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