Simplify formula

yomarcos

New Member
Joined
Aug 13, 2021
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a formula that works for me but I think there should be a way to simplify it.

=if(isblank(if($A8<>0, if($F8<>0, (IF($G8=False,"Ok to Allocate", if(isna(FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))), "Contractor", FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))))), "Contractor"), "No Project selected")), "Contractor", if($A8<>0, if($F8<>0, (IF($G8=False, "Ok to Allocate", if(isna(FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))), "Contractor", FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))))), "Contractor"), "No Project selected"))

As you can see, do to different IF functions, I am repeating the following 4 times
FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false)))

Is there a way to simplify this formula?

Thank you
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi, try the LET() function. You are on 365, so you should have it available.
In this function you can define intermediate results (like steps in a script) and provide these a name. In the next steps you can refer to any of the previous steps by using the name (thus not repeating the whole formula). The final step is the formula that returns the result. You might consider using IFS over IF as well.
 
Upvote 0
Hi Grah. Thank you very much for your ideas.
I put this thread on "General Discussion & Other Applications" because this is on Google sheets but I forgot to mentioned it on the post. My apologies. I don't have the LET function however, I will try to use IFS.

Thank you!!
 
Upvote 0
Hi, @yomarcos, sorry missed that on my smart phone.
The formula could have fooled me though... I'm not familiar with googlesheets, so I don't have a reflex to think it could be not excel.
 
Upvote 0
Hi,

If you can't use LET try this:
Excel Formula:
=IF($A8<>0,IF($F8<>0,(IF($G8=FALSE,"Ok to Allocate",IF(ISNA(FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))),"Contractor", FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))))),"Contractor"),"No Project selected")

This deletes two times the FILTER function because of the criterias used in the IF statement, it will never reach the FILTER function in that particular IF statement
 
Upvote 0
Hi,

If you can't use LET try this:
Excel Formula:
=IF($A8<>0,IF($F8<>0,(IF($G8=FALSE,"Ok to Allocate",IF(ISNA(FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))),"Contractor", FILTER(TRANSPOSE(indirect($B8)), (indirect("App_"&TO_TEXT(B8)&"_True_False!"&row($A8)&":"&row($A8))=false))))),"Contractor"),"No Project selected")

This deletes two times the FILTER function because of the criterias used in the IF statement, it will never reach the FILTER function in that particular IF statement
But you removed ISBLANK as well
 
Upvote 0
Compare the results between formulas, yours and mine, first and determine if, with the combination of IF functions you're already nested, you still think you need the ISBLANK part is necessary.

And remember TO_TEXT is a Google Sheets function!
 
Last edited:
Upvote 0
This is what worked best for me:

=if($A2<>0, IF(and($G2=False,$F2<>0),"Ok to Allocate", if(or(isna(FILTER(TRANSPOSE(indirect($B2)), (indirect(TO_TEXT(B2)&"_True_False!"&row($A2)&":"&row($A2))=false))),isblank(FILTER(TRANSPOSE(indirect($B2)), (indirect(TO_TEXT(B2)&"_True_False!"&row($A2)&":"&row($A2))=false)))), "Contractor", transpose(SORTN(transpose(FILTER(TRANSPOSE(indirect($B2)),(indirect(TO_TEXT(B2)&"_True_False!"&row($A2)&":"&row($A2))=false))),5)))),"No Project selected")
 
Upvote 0
Solution

Forum statistics

Threads
1,223,993
Messages
6,175,835
Members
452,674
Latest member
psion2600

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