Figuring out user status

skittlz

New Member
Joined
Oct 26, 2012
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a tab that has user and their status in 1 tab of raw data, and a final status in another tab. The raw data has multiple entries for the user AND status. How do I match all the entries, and figure out the (final) user status? The user status can be Active, Inactive, or Decertified. Decertified would supersede Inactive, Inactive would supersede Active. See Screenshot below!


Capture.PNG
re
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
maybe a count in an IF
whats the order
Decertified , inactive , active

=IF ( countifs($H$2:$H$100, A7, $I$2:$I$100, "decertified") , "decertified" , IF(countifs($H$2:$H$100, A7, $I$2:$I$100, "inactive"), "inactive", IF(countifs($H$2:$H$100, A7, $I$2:$I$100, "active"), "active", "" )))

but not sure , as thats not what shown in the diagram

so change the IF order to match the priority
 
Upvote 0
In my screenshot above - my current formula returns the 1st value only for status - not the "actual" value.
 

Attachments

  • Capture.PNG
    Capture.PNG
    39.8 KB · Views: 14
Upvote 0
what is the actual value required

I have put the order in the IF for a count formula to look at
=IF ( countifs($H$2:$H$100, A7, $I$2:$I$100, "decertified") , "decertified" , IF(countifs($H$2:$H$100, A7, $I$2:$I$100, "inactive"), "inactive", IF(countifs($H$2:$H$100, A7, $I$2:$I$100, "active"), "active", "" )))

so if decertified exists in RAW data for that user - then decertified is added to the status , and thats it , the IFs stops
however if decertified is not in the raw data for that user
then we do the next IF and see if "inactive" is in the raw data list - if not then the 3rd IF

so the order we look for is important as to what comes first,
so which order takes precedent

JIM would be decertified
BOB active
JOE decertified
HARRY Active
SAM InActive

so what should the order be for the status

whats the expected result ?
 
Upvote 0
Hi Etaf -that partially works - it sounds like the order of the "If's" will determine the higher-archy - is that correct? This is really helpful.

The Formula however doesn't take the "Doc#" in account. Here's the complexity:

1) If the person is "Inactive" - they are Inactive for ALL doc#s (that is - person is out of office, so cant be trained - so flagged as "inactive").
2) If a person is "decertified" to a given Doc# - they are ONLY decertified for that one document - not others.


Jim is Inactive for all Docs (1 and 2 - since he's Inactive for Doc 1)
Bob is Active for Doc 1 and 2
Joe is Decertified for 1, but Active for 2
Harry is Active for 1 and 2
Sam is Inactive for 1 and 2
 
Upvote 0
ok, i didnt realise doc number was important from the post - so its a lot more complicated then

you also have revison highlighted , is that also an issue - your example has the same revision , but would that need to be considered

you have doc number in B2 - so thats that number should be considered only for the status

it sounds like the order of the "If's" will determine the higher-archy - is that correct?
Yes

breaking it down a bit

Inactive - so doc does not matter so no need to check that
therefor a
(countifs($H$2:$H$100, A7, $I$2:$I$100, "inactive")
if 1 or more will be inactive status

decertified - depends on doc number
( countifs($H$2:$H$100, A7, $I$2:$I$100, "decertified" , $J$2:$J$100, $B$2)
Now we count to see if decertified and also includes the doc number

Active - you have not mentioned active - but looks like from the list - also needs doc number
countifs($H$2:$H$100, A7, $I$2:$I$100, "active", $J$2:$J$100, $B$2)

so again , i dont know the order of preference
1) If the person is "Inactive" - they are Inactive for ALL doc#s (that is - person is out of office, so cant be trained - so flagged as "inactive").
BUT thats not what is shown JIM is Active , are you saying that the table is NOT the expected results

JIM would be decertified
BOB active
JOE decertified
HARRY Active
SAM InActive

So
JIM has all possible status and Decertified is first - Because its also the same Book Number , so that comes first in the IF and overrides the other possible status , if the doc number is the same as B2
BOB is active - but hes active for all - so know idea what order from him
JOE - has all possible status Decertified or active - and as JIM decertified is first - Because its also the same Book Number , so that comes first in the IF and overrides the Active, if the doc number is the same as B2
HARRY - active but thats the only choice
SAM - could be inactive or active as same doc number - BUT inactive chosen - so inactive comes NEXT and Active last in the order

EDIT - opps i appear to have missed the doc number on the active statement - But i will let you come back to some of the answers before i correct all this - as only have 10mins and will need a new post
and most assumptions maybe wrong anyway

I'll let you answer the below as well



= IF( ( countifs($H$2:$H$100, A7, $I$2:$I$100, "decertified" , $J$2:$J$100, $B$2) , "decertified",
IF( countifs($H$2:$H$100, A7, $I$2:$I$100, "inactive") , "inactive",
IF( countifs($H$2:$H$100, A7, $I$2:$I$100, "active") , "active" , "" )))

=IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "decertified", $J$2:$J$100, $B$2),"decertified",IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "inactive"),"inactive",IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "active"),"active","" )))

i get a different result to you

JIM
2) If a person is "decertified" to a given Doc# - they are ONLY decertified for that one document - not others.
user
Jim I have decertified you have inactive - WHY, has decertified for 1
Bob I have active correct
sam I have inactive correct
joe I have active you have decrtified - WHY has doc 2 , so not doc1
harry I have active correct

i have mocked up just the main bits

Book12
ABCDEFGHIJKL
1
2doc1namestatusdocRev
3Jimactive1E
4revEjiminactive1E
5jimdecertified1E
6useryou sayjimactive2E
7Jimdecertifiedinactive - WHY, has decertified for 1bobactive1E
8Bobactivecorrectbobactive2E
9saminactivecorrectbobactive1E
10joeactivedecrtified - WHY has doc 2 , so not doc1 joedecertified2E
11harryactivecorrectjoeactive1E
12harryactive1E
13harryactive1E
14harryactive2E
15samactive2E
16saminactive1E
17samactive1E
18samactive3E
19samactive2E
Sheet1
Cell Formulas
RangeFormula
B7:B11B7=IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "decertified", $J$2:$J$100, $B$2),"decertified",IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "inactive"),"inactive",IF(COUNTIFS($H$2:$H$100, A7, $I$2:$I$100, "active"),"active","" )))



i have put on a share - BUT only for a few days and will be deleted


Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Last edited:
Upvote 0
Hi Etaf - the formulas above were very complex and I was struggling to get them to work (and they were slowing down the spreadsheet - ALOT) - I have thousands of entries to filter through. I ended up using a helper tab to minimize my search fields. Its simplified down to the user name, and a mix of status.

Is there any way to populate the "final" status in column C for each name?



1708973626604.png
 
Upvote 0
the formulas above were very complex
OK, but its just 3 count formulas
within an IF
and so executed one after the other if NOT true



how many thousands of rows .. i have used a count on very large excel sheets , BUT thats all relative
. I ended up using a helper tab to minimize my search fields. Its simplified down to the user name, and a mix of status.
therss only 3 columns in your example - is the real data a lot more complex than thats
otherwise HOW did you simplify ???

cant see much from a image , as mentioned
 
Upvote 0
Hi - I was trying to filter out "Inactive" (and "terminated", which are treated the same as inactive), and then copy the day over to a new tab but you're right - best to combine.

The order should be Terminated (everything), Inactive (everything), Decertified (that document ONLY), and Active (that document only - leftover).

=IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"terminated"),"Terminated",IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"Inactive"),"Inactive",IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"Decertified",'Training Log'!E:E,'Training Matrix'!$B$1),"Active","")))

I got the "terminated" and "inactive" - if they're terminated/inactive, it updates ALL the documents. I cant get the decertificate to work. What am I missing?

Regards,

- Ritul
 
Last edited:
Upvote 0
,IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"Decertified",'Training Log'!E:E,'Training Matrix'!$B$1),"Active","")))

you are not outputting "decertified" any where - just active, and if not then a blank
maybe thats why - Active is in place of decertified in your equation
change that bit to
,IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"Decertified",'Training Log'!E:E,'Training Matrix'!$B$1),"Decertified", "Active")))
BUT that assumes it must be active if none of the other are true
,IF(COUNTIFS('Training Log'!A:A,Formulas!A2,'Training Log'!B:B,"Decertified",'Training Log'!E:E,'Training Matrix'!$B$1),"Decertified", IF( TEST, "Active", ""))))

BUT you probably want and active condition IF as well
if you want "" at the end
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,594
Members
452,656
Latest member
earth

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