Need to add one condition to the formula

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello guys

I need your expert help to add a condition to the formula. I want to edit the formula in column J to get the correct result. If the rates in column N are different then the formula in column J should add the taxable value in column H and display in column J. If the rates in column N are same then the formula in column J should not add the taxable value but show one value only in column J.

Book1
ABCDEFGHIJKLMNO
1ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTcombine taxableCombined TaxCGSTSGSTRate (%)
2152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.320.002159.32194.34194.34194.3418
31139AALCA3377L3Z6Customer 2SMN008305200257711863.560.0023727.122135.441067.721067.7218MISTAKE
433839AALCA3377L3Z6Customer 2SMN008305200257711863.560.00Delete RowDelete Row1067.721067.7218
5164534AAECB3833N3ZUCustomer 3GST-53026733.501336.6826733.501336.680.000.005
68639AACCC8357H3ZECustomer 4181/2020-211300.000.001300.00117.00117.00117.0018
7161539ABHPC3938R3Z8Customer 5ICHABE202100050412480.500.0018540.341968.331123.251123.2518CORRECT
8161639ABHPC3938R3Z8Customer 5ICHABE20210005046031.270.00Delete RowDelete Row844.37844.3728
9161739ABHPC3938R3Z8Customer 5ICHABE202100050428.570.00Delete RowDelete Row0.710.715
1037737AELPN4353H3ZCCustomer 6IN-462531072.88193.122145.76386.240.000.0018MISTAKE
116837AELPN4353H3ZCCustomer 6IN-462531072.88193.12Delete RowDelete Row0.000.0018
1261839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.520.0051509.521287.741287.741287.745
1378339AAJFD5433B3ZRCustomer 7KA-1274-20-212761.900.0025714.581446.2169.0569.055CORRECT
1478439AAJFD5433B3ZRCustomer 7KA-1274-20-2122952.680.00Delete RowDelete Row1377.161377.1612
15178237AAHPG6373H3ZOCustomer 82020-21-124326880.001344.0026880.001344.000.000.005
COMBINE TAXABLE VALUE
Cell Formulas
RangeFormula
J2:J15J2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(H:H,C:C,C2,E:E,E2),"Delete Row")
K2:K15K2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,IF(I2<>0,SUMIFS(I:I,C:C,C2,E:E,E2),SUMIFS(L:L,C:C,C2,E:E,E2)),"Delete Row")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E15Expression=COUNTIFS(D$2:D$15,D2,E$2:E$15,E2)>1textNO
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Is it ok to add a helper column? I'm not going to say that it will be impossible without, but it's not going to be far from it.
 
Upvote 0
Is it ok to add a helper column? I'm not going to say that it will be impossible without, but it's not going to be far from it.
Column J is the helper column. Since I have not added a condition in the formula, it is combining all the taxable amounts. I think one more if condition in the formula about the rate, will help to solve the problem. But as there is a condition to match the TIN and Name also is a bit of a challenge for me
 
Upvote 0
=IF(N2=N3,J2,IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(H:H,C:C,C2,E:E,E2),"Delete Row"))
N2=N3 needs to be edited, then maybe it will work
 
Upvote 0
Column J is the helper column.
No it isn't, a helper column would be feeding the results to another formula as in the sheet below which yours is not doing.
Book1
ABCDEFGHIJKLMNO
1ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTHelperCombined TaxCGSTSGSTRate (%)combine taxable
2152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.3202159.32194.34194.34194.34182159.32
31139AALCA3377L3Z6Customer 2SMN008305200257711863.56011863.562135.441067.721067.721811863.56
433839AALCA3377L3Z6Customer 2SMN008305200257711863.560 Delete Row1067.721067.7218Delete Row
5164534AAECB3833N3ZUCustomer 3GST-53026733.51336.6826733.51336.6800526733.5
68639AACCC8357H3ZECustomer 4181/2020-21130001300117117117181300
7161539ABHPC3938R3Z8Customer 5ICHABE202100050412480.5012480.51968.331123.251123.251818540.34
8161639ABHPC3938R3Z8Customer 5ICHABE20210005046031.2706031.27Delete Row844.37844.3728Delete Row
9161739ABHPC3938R3Z8Customer 5ICHABE202100050428.57028.57Delete Row0.710.715Delete Row
1037737AELPN4353H3ZCCustomer 6IN-462531072.88193.121072.88386.2400181072.88
116837AELPN4353H3ZCCustomer 6IN-462531072.88193.12 Delete Row0018Delete Row
1261839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.52051509.521287.741287.741287.74551509.52
1378339AAJFD5433B3ZRCustomer 7KA-1274-20-212761.902761.91446.2169.0569.05525714.58
1478439AAJFD5433B3ZRCustomer 7KA-1274-20-2122952.68022952.68Delete Row1377.161377.1612Delete Row
15178237AAHPG6373H3ZOCustomer 82020-21-124326880134426880134400526880
Sheet1
Cell Formulas
RangeFormula
J2:J15J2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2,N$2:N2,N2)=1,H2,"")
K2:K15K2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,IF(I2<>0,SUMIFS(I:I,C:C,C2,E:E,E2),SUMIFS(L:L,C:C,C2,E:E,E2)),"Delete Row")
O2:O15O2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(J:J,C:C,C2,D:D,D2,E:E,E2),"Delete Row")
 
Upvote 0
Solution
No it isn't, a helper column would be feeding the results to another formula as in the sheet below which yours is not doing.
Book1
ABCDEFGHIJKLMNO
1ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTHelperCombined TaxCGSTSGSTRate (%)combine taxable
2152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.3202159.32194.34194.34194.34182159.32
31139AALCA3377L3Z6Customer 2SMN008305200257711863.56011863.562135.441067.721067.721811863.56
433839AALCA3377L3Z6Customer 2SMN008305200257711863.560 Delete Row1067.721067.7218Delete Row
5164534AAECB3833N3ZUCustomer 3GST-53026733.51336.6826733.51336.6800526733.5
68639AACCC8357H3ZECustomer 4181/2020-21130001300117117117181300
7161539ABHPC3938R3Z8Customer 5ICHABE202100050412480.5012480.51968.331123.251123.251818540.34
8161639ABHPC3938R3Z8Customer 5ICHABE20210005046031.2706031.27Delete Row844.37844.3728Delete Row
9161739ABHPC3938R3Z8Customer 5ICHABE202100050428.57028.57Delete Row0.710.715Delete Row
1037737AELPN4353H3ZCCustomer 6IN-462531072.88193.121072.88386.2400181072.88
116837AELPN4353H3ZCCustomer 6IN-462531072.88193.12 Delete Row0018Delete Row
1261839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.52051509.521287.741287.741287.74551509.52
1378339AAJFD5433B3ZRCustomer 7KA-1274-20-212761.902761.91446.2169.0569.05525714.58
1478439AAJFD5433B3ZRCustomer 7KA-1274-20-2122952.68022952.68Delete Row1377.161377.1612Delete Row
15178237AAHPG6373H3ZOCustomer 82020-21-124326880134426880134400526880
Sheet1
Cell Formulas
RangeFormula
J2:J15J2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2,N$2:N2,N2)=1,H2,"")
K2:K15K2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,IF(I2<>0,SUMIFS(I:I,C:C,C2,E:E,E2),SUMIFS(L:L,C:C,C2,E:E,E2)),"Delete Row")
O2:O15O2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(J:J,C:C,C2,D:D,D2,E:E,E2),"Delete Row")
Jsonb75. The result in column O is correct. I have to add another helper column along with column J. Right.
Is it possible to get the same result as in O in column J in place of the data in column J.?
 
Upvote 0
This is how the original data is displayed. I have added 2 helper columns, one is combined tax and the other is combined taxable. I have to add another additional helper column for combined tax too as it has also to be changed. total of 4 columns. If possible I want to make it in 2 columns only to make it less complicated.

combine taxable value.xlsx
ABCDEFGHIJKL
1ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTCGSTSGSTRate (%)
2152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.320.00194.34194.3418
31139AALCA3377L3Z6Customer 2SMN008305200257711863.560.001067.721067.7218
433839AALCA3377L3Z6Customer 2SMN008305200257711863.560.001067.721067.7218
5164534AAECB3833N3ZUCustomer 3GST-53026733.501336.680.000.005
68639AACCC8357H3ZECustomer 4181/2020-211300.000.00117.00117.0018
7161539ABHPC3938R3Z8Customer 5ICHABE202100050412480.500.001123.251123.2518
8161639ABHPC3938R3Z8Customer 5ICHABE20210005046031.270.00844.37844.3728
9161739ABHPC3938R3Z8Customer 5ICHABE202100050428.570.000.710.715
1037737AELPN4353H3ZCCustomer 6IN-462531072.88193.120.000.0018
116837AELPN4353H3ZCCustomer 6IN-462531072.88193.120.000.0018
1261839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.520.001287.741287.745
1378339AAJFD5433B3ZRCustomer 7KA-1274-20-212761.900.0069.0569.055
1478439AAJFD5433B3ZRCustomer 7KA-1274-20-2122952.680.001377.161377.1612
15178237AAHPG6373H3ZOCustomer 82020-21-124326880.001344.000.000.005
Combine taxable values (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E15Expression=COUNTIFS(D$2:D$15,D2,E$2:E$15,E2)>1textNO
 
Upvote 0
Is it possible to get the same result as in O in column J in place of the data in column J.?
I don't think that it will be possible without the helper column. If it can be done then it will require a very complex and inefficient formula, especially given that you don't have office 365.
I have added 2 helper columns, one is combined tax and the other is combined taxable.
As I said earlier, those are not helper columns, they are summary formulas that are not working. A helper creates an intermediate result that another formula can use in order to return the final result more efficiently.
 
Upvote 0
I don't think that it will be possible without the helper column. If it can be done then it will require a very complex and inefficient formula, especially given that you don't have office 365.

As I said earlier, those are not helper columns, they are summary formulas that are not working. A helper creates an intermediate result that another formula can use in order to return the final result more efficiently.
Ok. I know it is a little complicated. Let me try your way of doing it. With the help of your formula, I will edit the formula with your this part of the formula N$2:N2,N2)=1,H2,""). That will be helpful. Will share it with you once I get it.
 
Upvote 0
I understood your formula and did some editing and got the required result. Thanks Jasonb75.
combine taxable value.xlsx
ABCDEFGHIJKLMNOP
1ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTHelper 1Combined TaxableHelper 2Combine taxCGSTSGSTRate (%)
2152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.320.002159.322353.66194.34212.34194.34194.3418
31139AALCA3377L3Z6Customer 2SMN008305200257711863.560.0011863.5612931.281067.721085.721067.721067.7218
433839AALCA3377L3Z6Customer 2SMN008305200257711863.560.00Delete RowDelete RowDelete RowDelete Row1067.721067.7218
5164534AAECB3833N3ZUCustomer 3GST-53026733.501336.6826733.526733.5050.000.005
68639AACCC8357H3ZECustomer 4181/2020-211300.000.0013001417117135117.00117.0018
7161539ABHPC3938R3Z8Customer 5ICHABE202100050412480.500.0012480.520508.671123.251986.331123.251123.2518
8161639ABHPC3938R3Z8Customer 5ICHABE20210005046031.270.006031.27Delete Row844.37Delete Row844.37844.3728
9161739ABHPC3938R3Z8Customer 5ICHABE202100050428.570.0028.57Delete Row0.71Delete Row0.710.715
1037737AELPN4353H3ZCCustomer 6IN-462531072.88193.121072.881072.880180.000.0018
116837AELPN4353H3ZCCustomer 6IN-462531072.88193.12Delete RowDelete RowDelete RowDelete Row0.000.0018
1261839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.520.0051509.5252797.261287.741292.741287.741287.745
1378339AAJFD5433B3ZRCustomer 7KA-1274-20-212761.900.002761.927160.7969.051451.2169.0569.055
1478439AAJFD5433B3ZRCustomer 7KA-1274-20-2122952.680.0022952.68Delete Row1377.16Delete Row1377.161377.1612
15178237AAHPG6373H3ZOCustomer 82020-21-124326880.001344.002688026880050.000.005
16
17FINAL RESULT
18ABTINNAMEInvoice numberCDTaxable Value (₹)IGSTCGSTSGSTRate (%)
1937737AELPN4353H3ZCCustomer 6IN-462531072.88193.120018
20164534AAECB3833N3ZUCustomer 3GST-53026733.51336.68005
21178237AAHPG6373H3ZOCustomer 82020-21-1243268801344.00005
228639AACCC8357H3ZECustomer 4181/2020-2113000.0011711718
23152439AKXPR3359E3ZJCustomer 1IN-ZSHB-371052159.320.00194.34194.3418
241139AALCA3377L3Z6Customer 2SMN008305200257711863.560.001067.721067.7218
2561839AAJFD5433B3ZRCustomer 7KA-1176-20-2151509.520.001287.741287.745
2678339AAJFD5433B3ZRCustomer 7KA-1274-20-2125714.580.001446.211446.215
27161539ABHPC3938R3Z8Customer 5ICHABE202100050418540.340.001968.331968.3318
28
COMBINE TAXABLE VALUE
Cell Formulas
RangeFormula
J2:J15J2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2,P$2:P2,P2)=1,H2,"Delete Row")
K2:K15K2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(J:J,C:C,C2,D:D,D2,E:E,E2),"Delete Row")
L2:L15L2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2,P$2:P2,P2)=1,N2,"Delete Row")
M2:M15M2=IF(COUNTIFS(C$2:C2,C2,E$2:E2,E2)=1,SUMIFS(L:L,C:C,C2,D:D,D2,E:E,E2),"Delete Row")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E19:E27Expression=COUNTIFS(D$2:D$10,D19,E$2:E$10,E19)>1textNO
E2:E15Expression=COUNTIFS(D$2:D$15,D2,E$2:E$15,E2)>1textNO
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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