formula that will give a value depending on the group of the given value

mark692

Active Member
Joined
Feb 27, 2015
Messages
321
Office Version
  1. 2016
Platform
  1. Windows
good day is there a formula for a column that will give me a value on column REMARKS. In my sample I have column G for girls and column B for boys column C is their group and column D is the remarks where I want to put a formula. if column A names is within a group Remarks will give me text "Girls", like on my example Anna Marie and Juliet is within Group A thats why remarks give me text "Girls", as you can see in my example cell A5 has no name and because it is within group a i want it also to have Girls on remarks. thanks


Book1
ABCD
1GBGroupRemarks
2AnnaAGirls
3MarieAGirls
4JuletAGirls
5AGirls
6BenBBoys
7RonBBoys
8BBoys
9BBoys
10LizaCCombined
11ArthurCCombined
12CCombined
Sheet1
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Remarks = Table.AddColumn(Source, "Remarks", each if ([G] <> null or [G] = null) and [Group] = "A" then "Girls" else if ([B] <> null or [B] = null) and [Group] = "B" then "Boys" else "Combined")
in
    Remarks
GBGroupGBGroupRemarks
AnnaAAnnaAGirls
MarieAMarieAGirls
JuletAJuletAGirls
AAGirls
BenBBenBBoys
RonBRonBBoys
BBBoys
BBBoys
LizaCLizaCCombined
ArthurCArthurCCombined
CCCombined

this can be easily translated into a worksheet formula
 
Upvote 0
try this in D2 and copy down

=IF(COUNTIFS($A$2:$A$12,"<>"&"",$C$2:$C$12,C2)>0,IF(COUNTIFS($B$2:$B$12,"<>"&"",$C$2:$C$12,C2)>0,"Combined","Girls"),"Boys")
 
Upvote 0
try this in D2 and copy down

=IF(COUNTIFS($A$2:$A$12,"<>"&"",$C$2:$C$12,C2)>0,IF(COUNTIFS($B$2:$B$12,"<>"&"",$C$2:$C$12,C2)>0,"Combined","Girls"),"Boys")


thank you sir this will do! :)
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

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