Formula require

Ketan_ashiyani

New Member
Joined
Sep 12, 2024
Messages
13
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Dear Team

We need to solution as per attached sheet and screen shot.

Note Type

Result Require :

1. State cell is Blank Result require is 0,
2. Type cell is C and State Cell is not blank. The result required is (-) negative value
3. Type cell is Blank and state cell is not blank result required is positive value

TypeStateAmount in INRResult Require
08-Rajasthan100
23-Madhya Pradesh200
C24-Gujarat300
600
27-Maharashtra1,000
08-Rajasthan2,000
3,000
C27-Maharashtra5,000
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hello, like this?

Excel Formula:
=IFS(ISBLANK(B2),0,AND(A2="C",ISTEXT(B2)),-C2,AND(ISBLANK(A2),ISTEXT(B2)),C2)
 
Upvote 0
in D2 (adjust if your screenshot does not start from A1) formula:
VBA Code:
=IF(B2<>"",IF(A2="C",-C2,C2),0)
and copy down
 
Upvote 0
Solution
We do not need nesting IFs:

Excel Formula:
=IFS($B3="",0,AND($A3="C",$B3<>""),-$C3,AND($A3="",$B3<>""),C3)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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