Need help on Nested if or IFs

tinferns

Board Regular
Joined
Aug 18, 2009
Messages
150
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
=IF(SEARCH($G$2,C6,1),"Expense1"),IF(D6="",""),IF(D6<0,"Earning"),IF(D6>0,"Expense"),IF(D6=0,"")

=IFS(SEARCH($G$2,C6,1),"Expense1",D7="","",D7<0,"Earning",D7>0,"Expense",D7=0,"")

Both the above functions are giving me an error. This function is respecting only the first criteria to search for G2. Ideally, I want the formula to look for > or < or = if G2 does not match. Help, please.

Thanks...
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Excel Formula:
=IF(ISNUMBER(SEARCH($G$2,C6,1)),"Expense1",IF(D6="","",IF(D6<0,"Earning",IF(D6>0,"Expense",""))))
 
Upvote 0
Solution
One more point is that there could be more than 1 TRUE result. In such cases I am ok for excel to consider the 1st TRUE result and act
Excel Formula:
=IF(ISNUMBER(SEARCH($G$2,C6,1)),"Expense1",IF(D6="","",IF(D6<0,"Earning",IF(D6>0,"Expense",""))))
That was magnificent AlphaFrog.. it worked. Thanks a ton.. Cheers...
 
Upvote 0

Forum statistics

Threads
1,215,409
Messages
6,124,737
Members
449,185
Latest member
hopkinsr

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