Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2020, 03:32 AM
Marcia's Avatar
Marcia Marcia is offline Return as many Y as the number of occurrence of values in another column Windows 7 32bit Return as many Y as the number of occurrence of values in another column Office 2013
Expert
Return as many Y as the number of occurrence of values in another column
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default Return as many Y as the number of occurrence of values in another column

Hi. Wi fi and hotspot are not possible so I hope that without a sample attachment I could still get a solution to this problem.
Column A consists of values that are duplicated more than once, but the duplicates are contiguous to each other.
Column B consists of other sets of values.
I would like a formula in column C that returns Y if Column B has 1 or 2 . The Y should start from the first row of the sets of duplicated values in Col A.
Example:
A B C


C Y
C 2 Y
C Y
D
D
G Y
G 1 Y
G 1 Y
G Y
Thank you. I cannot properly align the values, all Y should be in Col C.
Reply With Quote
  #2  
Old 11-27-2020, 05:19 AM
ArviLaanemets ArviLaanemets is offline Return as many Y as the number of occurrence of values in another column Windows 8 Return as many Y as the number of occurrence of values in another column Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Into C2 enter formula like
Code:
=IF(AND(OR($A2=$A1,$A2=$A3),OR(COUNTIFS($A$2:$A$10,$A2,$B$2:$B$10,1)>0,COUNTIFS($A$2:$A$10,$A2,$B$2:$B$10,2)>0)),"Y","")
, and copy down.
Reply With Quote
  #3  
Old 11-27-2020, 04:19 PM
Marcia's Avatar
Marcia Marcia is offline Return as many Y as the number of occurrence of values in another column Windows 7 32bit Return as many Y as the number of occurrence of values in another column Office 2013
Expert
Return as many Y as the number of occurrence of values in another column
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

Quote:
Originally Posted by ArviLaanemets View Post
Into C2 enter formula like
Code:
=IF(AND(OR($A2=$A1,$A2=$A3),OR(COUNTIFS($A$2:$A$10,$A2,$B$2:$B$10,1)>0,COUNTIFS($A$2:$A$10,$A2,$B$2:$B$10,2)>0)),"Y","")
, and copy down.
Thank you Arvi. In my several attempts to write the code before I threw down the towel and sought this forum's help, I used the IF, AND, OR and COUNTIFS but combining them into one logical formula was really beyond me.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Picture attached. Need one column to return sum of another column. IRHSAM Excel 3 11-18-2017 01:21 AM
Return as many Y as the number of occurrence of values in another column Excel / Mail Merge - Return Column Headers for All and Any Columns with Values eduams Mail Merge 1 09-26-2016 07:02 PM
Formula/function to return column names for matching values GiJoe81 Excel 1 06-27-2015 12:13 AM
Return Sum value of one column from cells not blank in another column zulugandalf Excel 3 08-14-2014 03:37 AM
Return as many Y as the number of occurrence of values in another column Need to search a column for a macth and return a result from a third column pdfaust Excel 2 02-03-2011 03:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft