Formula with IF & And if Blank then 0

Yogesh977

New Member
Joined
Nov 24, 2020
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Dear Expert,

Please help me with below formula in not able to capture formula if cell one cell or both cell is blank. for reference Image with formula attached and sheet as below

i need you help please help me if its possible for you all experts.
Thank for your support.

ABCDEFGHIJK
1​
StatusSr.No.My Tax NumberVendor Tax NumberProduct AmtTax %Central Tax @9%State Tax @9%Integrated Tax @18%Total Invoice AmtRemark
2​
Correct1st Formula2727100018%90900180if My tax and Vendor tax are same then Central and State tax calculation and Integrated tax 0 (this formula is correct)
3​
Correct2nd Formula2726100018%00180180if My tax and Vendor tax are Different then Central and State tax is "0" and Integrated tax calculated on Tax rate (this formula is correct)
4​
Not able to do3rd Formula27100018%00180180if My tax Number is Applicable and Vendor tax is Blank then Central, State tax and Integrated tax Should be "0", (this I'm not able to find how to do)
 

Attachments

  • Image Formula.jpeg
    Image Formula.jpeg
    65.2 KB · Views: 8

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
Please Use XL2BB to upload your example file. Also Show Cell D9.
 

Attachments

  • 23444.jpg
    23444.jpg
    61.5 KB · Views: 4
Upvote 0
Rich (BB code):
24.11.2020.xlsx
ABCDEFGHIJ
1StatusSr.No.My Tax NumberVendor Tax NumberProduct AmtTax %Central Tax @9%State Tax @9%Integrated Tax @18%Total Invoice Amt
2Correct1st Formula18AABCU9603R1ZM18AABCU9603R1Z2100018%90900180
3Correct2nd Formula10AABCU9603R1Z204AABCU9603R1ZV100018%00180180
4Not able to do3rd Formula22AABCU9603R1ZX100018%0000
Sheet1
Cell Formulas
RangeFormula
I2:I4I2=IF(LEFT(C2,2)<>LEFT(D2,2),(E2*F2)*(1-(SUM(--(C2:D2=""))>0)),0)
J2:J4J2=SUM(Sheet1!$G2:$I2)
 
Upvote 0
This Part of Your formula is array and you use SHIFT+CTRL+ENTER not ENTER:
SUM(--(C3:D3=""))

Also I don't see how your last Row formula take data from one lower row ( No data).
 
Last edited:
Upvote 0
In I4 You can Write (change Your formula to what you want):
Excel Formula:
=IF(AND(C4<>"",D4=""),0,Your Formula)

and drag it up and down if needed
 
Upvote 0
This Part of Your formula is array and you use SHIFT+CTRL+ENTER not ENTER:
SUM(--(C3:D3=""))

Also I don't see how your last Row formula take data from one lower row ( No data).
I guess he is using office 365 as he has mentioned in his profile. In that case, even a normal ENTER would work.

However, if he isn't then he will have to use SHIFT+CTRL+ENTER.
 
Upvote 0
Thank to all of you for your kind reply and support my be my explanations is not correct please refer this one
my Concern is my all formula is working fine what i want my only difficulty is if Vendor Tax Number is Blank then nothing to be calculated in Central,state, Integrated and show 0 value

Note:
I want red highlighted to be 0 value after my formula (if Vendor Tax Number is Blank then nothing is calculated in Central,state, Integrated)
1st Formula : IF My Tax Number and Vendor Tax Number Is Same Then Central Tax & State Tax is calculate and integrated tax should not calculate
2nd Formula :IF My Tax Number and Vendor Tax Number Is Different Then Central Tax & State Tax Should calculate 0 or blank and integrated should calculate
3rd Formula : if Vendor Tax Number is Blank then nothing to be calculated in Central,state, Integrated

GST Formula.xlsx
ABCDEFGHIJKLMN
1StatusSr.No.My Tax NumberVendor Tax NumberProduct AmtTax %Central Tax @9%State Tax @9%Integrated Tax @18%Total Invoice Amt
2Correct1st Formula18AABCU9603R1ZM18AABCU9603R1Z2100018%909001180
3Correct2nd Formula18AABCU9603R1Z204AABCU9603R1ZV100018%001801180
4Not able to do3rd Formula18AABCU9603R1Z2100018%001801180
5
6want like this3rd Formula18AABCU9603R1Z2100018%0001000Manual amount done need in formula
7
8
9
Sheet2
Cell Formulas
RangeFormula
G2:G4G2=IF(LEFT(C2,2)=LEFT(D2,2),E2*F2/2,0)
H2:H4H2=IF(LEFT(C2,2)=LEFT(D2,2),E2*F2/2,0)
I2:I4I2=IF(LEFT(C2,2)<>LEFT(D2,2),E2*F2,0)
J6,J2:J4J2=SUM(G2:I2)+E2
 
Upvote 0
Change I2 to this and drag it down:
Excel Formula:
=IF(OR(LEFT(C2,2)<>LEFT(D2,2),D2="",C2=""),E2*F2,0)

this is for if Column C or D is blank. if you want only for D use this

Excel Formula:
=IF(OR(LEFT(C2,2)<>LEFT(D2,2),D2=""),E2*F2,0)
 
Upvote 0
Change I2 to this and drag it down:
Excel Formula:
=IF(OR(LEFT(C2,2)<>LEFT(D2,2),D2="",C2=""),E2*F2,0)

this is for if Column C or D is blank. if you want only for D use this

Excel Formula:
=IF(OR(LEFT(C2,2)<>LEFT(D2,2),D2=""),E2*F2,0)
Not Working



GST Formula.xlsx
ABCDEFGHIJ
1StatusSr.No.My Tax NumberVendor Tax NumberProduct AmtTax %Central Tax @9%State Tax @9%Integrated Tax @18%Total Invoice Amt
2Correct1st Formula18AABCU9603R1ZM18AABCU9603R1Z2100018%909001180
3Correct2nd Formula18AABCU9603R1Z204AABCU9603R1ZV100018%001801180
4Not able to do3rd Formula18AABCU9603R1Z2100018%001801180
Sheet2
Cell Formulas
RangeFormula
G2:G4G2=IF(LEFT(C2,2)=LEFT(D2,2),E2*F2/2,0)
H2:H4H2=IF(LEFT(C2,2)=LEFT(D2,2),E2*F2/2,0)
I2:I4I2=IF(OR(LEFT(C2,2)<>LEFT(D2,2),D2="",C2=""),E2*F2,0)
J2:J4J2=SUM(G2:I2)+E2
 
Upvote 0
Sorry My fault:
Excel Formula:
=IF(OR(D2="",C2=""),0,IF(LEFT(C2,2)<>LEFT(D2,2),E2*F2,0)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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