If function

Kelleyscott

New Member
Joined
May 21, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
1650516085192.png

I would like to know what is the full IF function with regards to the above screen shot.

If all cells B1:B5 are noted as "Joint" then the B6 result = "Joint"
If all cells B1:B5 are noted as "Sole" then the B6 result = "Sole"

However if any one of B1, B2, B3, B4, B5 is Joint or Sole (therefore B1:B5 are not all the same) then I require the outcome to be "Joint/Sole"

I was hoping there was a shorter IF function rather than building out a long one with all variations?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You could also use this shortened version of the suggested formula.
Excel Formula:
=IF(AND(EXACT(B1:B5,B1)),B1,"Joint/Sole")

Further, I suspect that upper/lower case would not matter (or is not possible) and if that is the case, no need for EXACT either.
Excel Formula:
=IF(AND(B1:B5=B1),B1,"Joint/Sole")
 
Upvote 0
For Excel version earlier than 365 (or maybe, earlier than 2019?), array formula in #4 need to be confirmed by Ctrl-Shift-Enter
Another version, non-array formula:
Code:
=IF(COUNTIF(B1:B5,B1)=5,B1,"Joint/Sole")
or longer a bit:
Code:
=LOOKUP(COUNTIF(B1:B5,"Joint"),{0,1,5},{"Sole","Joint/Sole","Joint"})
 
Upvote 0
In terms of non-array formulas probably a bit more robust but longer.
Excel Formula:
=IF(COUNTIF(B1:B5,B1)=(COUNTA(B1:B5)+COUNTBLANK(B1:B5)),B1,"Joint/Sole")
OR
Excel Formula:
=IF(COUNTIF(B1:B5,B1)=(ROW(B5)-ROW(B1)+1),B1,"Joint/Sole")
 
Upvote 0
WIth this formula if B1, B2 & B3 are "Joint" and B4 and B5 are blank - the result comes out at Joint/Sole.... which is incorrect.
.. but it is what you said in post 1 that you wanted.

therefore B1:B5 are not all the same) then I require the outcome to be "Joint/Sole"
In what you have shown and described in post #7, B1:B5 are not all the same. That is why all (I think) suggestions in the the thread will produce "Join/Sole" for this latest example.

You also stated the following, which also implies that if all B1:B5 are not "Joint" then the result would not be "Joint"
If all cells B1:B5 are noted as "Joint" then the B6 result = "Joint"

So, it seems your original description is not what you actually wanted.

Looks to me now what you really want is the formula in B6 below?
I have copied it across to show results for various data samples.

22 04 21.xlsm
BCDEFGH
1JointJointJoint
2JointSoleJointSoleJoint
3SoleJointSole
4SoleJointJointJoint
5Joint
6JointSoleJoint JointSoleJoint/Sole
Joint
Cell Formulas
RangeFormula
B6:H6B6=LET(f,UNIQUE(FILTER(B1:B5,B1:B5<>"","")),IF(ROWS(f)=1,f,"Joint/Sole"))
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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