IF functions slightly too complicated for my tiny brain

MrSak87

New Member
Joined
Jan 8, 2015
Messages
44
Hey guys,

Literally had no idea of what to put for the title of this one but here it goes. So in a separate column say column E I want a formula that returns "true" when the following condition is met:

B1 occurs for the first time in a unit but not any other time unless the unit changes. Units are from A1 downwards (numbers 1,2 and 3 in this example) If B1 occurs again but the unit hasn't changed then I don't want "true" to appear.

So in the example below E1 would = false, E2 would equal true, Then false all the way to E10, true for E11 etc.

unit
1SANDP1
1SANDP1B1B1
1SANDP1Q1Q1
1SANDP1U1U1
1SANDP1B2B2
1SANDP2
1SANDP2B1B1
1SANDP2B2B2
2CLAYP2Q1Q1
2CLAYP3
2CLAYP3B1B1
2CLAYP3Q1Q1
2CLAYP3U1U1
2CLAYP4
2CLAYP4B1B1
2CLAYP4Q1Q1
2CLAYP4Q2Q2
2CLAYP5
2CLAYP5B1B1
3CLAYP5U1U1
3CLAYP5Q1Q1
3CLAYP5B2B2
3CLAYP6
3CLAYP6B1B1
3CLAYP6Q1Q1
3CLAYP6B2B2
3CLAYP7
3SANDP7B1B1
3CLAYP7B2B2
3CLAYP7U1U1
3CLAYP7Q1Q1
3CLAYP7B3B3

<tbody>
</tbody>


Sorry if the explanation is rubbish but I think you'll get the idea. Cheers!
 
This is what we should get

UnitLithSampleSub
1SANDP1FALSE
1SANDP1B1B1TRUE
1SANDP1Q1Q1FALSE
1SANDP1U1U1FALSE
1SANDP1B2B2FALSE
1SANDP2FALSE
1SANDP2B1B1FALSE
1SANDP2B2B2FALSE
2CLAYP2Q1Q1FALSE
2CLAYP3FALSE
2CLAYP3B1B1TRUE
2CLAYP3Q1Q1FALSE
2CLAYP3U1U1FALSE
2CLAYP4FALSE
2CLAYP4B1B1FALSE
2CLAYP4Q1Q1FALSE
2CLAYP4Q2Q2FALSE
2CLAYP5FALSE
2CLAYP5B1B1FALSE
3CLAYP5U1U1FALSE
3CLAYP5Q1Q1FALSE
3CLAYP5B2B2FALSE
3CLAYP6FALSE
3CLAYP6B1B1TRUE
3CLAYP6Q1Q1FALSE
3CLAYP6B2B2FALSE
3CLAYP7FALSE
3SANDP7B1B1FALSE
3CLAYP7B2B2FALSE
3CLAYP7U1U1FALSE

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
reply mines works but the web site treats the Less than symbol as something else when i post it

=IF(AND(D2="B1", COUNTIF($E$1:E1,TRUE) lessthan A2),TRUE,FALSE)


what it does is say if current D row = "B1" and Current count of trues above is less than the A column number then its true otherwise false
 
Last edited:
Upvote 0
Sorry non of these solutions appear to work. With Marcelos I get #NAME? on every "B1" and the other formula Charles' formula is incomplete. If I complete it I get a 0 on every "B1"

What version of Excel are you using?

M.
 
Upvote 0
This is what we should get

Unit
Lith
Sample
Sub
1
SAND
P1
FALSE
1
SAND
P1B1
B1
TRUE
1
SAND
P1Q1
Q1
FALSE
1
SAND
P1U1
U1
FALSE
1
SAND
P1B2
B2
FALSE
1
SAND
P2
FALSE
1
SAND
P2B1
B1
FALSE
1
SAND
P2B2
B2
FALSE
2
CLAY
P2Q1
Q1
FALSE
2
CLAY
P3
FALSE
2
CLAY
P3B1
B1
TRUE
2
CLAY
P3Q1
Q1
FALSE
2
CLAY
P3U1
U1
FALSE
2
CLAY
P4
FALSE
2
CLAY
P4B1
B1
FALSE
2
CLAY
P4Q1
Q1
FALSE
2
CLAY
P4Q2
Q2
FALSE
2
CLAY
P5
FALSE
2
CLAY
P5B1
B1
FALSE
3
CLAY
P5U1
U1
FALSE
3
CLAY
P5Q1
Q1
FALSE
3
CLAY
P5B2
B2
FALSE
3
CLAY
P6
FALSE
3
CLAY
P6B1
B1
TRUE
3
CLAY
P6Q1
Q1
FALSE
3
CLAY
P6B2
B2
FALSE
3
CLAY
P7
FALSE
3
SAND
P7B1
B1
FALSE
3
CLAY
P7B2
B2
FALSE
3
CLAY
P7U1
U1
FALSE

<TBODY>
</TBODY>

D2, copied down:

=AND($D2="B1",COUNTIFS($A$2:A2,A2,$D$2:D2,"B1")=1)
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,654
Members
449,245
Latest member
PatrickL

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