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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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