MULTIPLE IF AND OR FUNCTIONS

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello experts, I am posting the image of the file with full details. If it is possible to enter a formula as discussed in the sheet.....
Query Multiple IF's.xlsx
ABCDEFGHJLNPQRSTUVWX
1STATIC VALUEVARIABLE COLUMNSCOLUMNS WHERE THE FORMULA TO BE ENTEREDVARIABLE COLUMNS
2GRAND TOTALA TOTALB TOTALABCDABCDR/ODiff
3Rows for reference onlyxx51218282.56914
41051001002.5-50ROW 4ROW 5ROW 6ROW 7
51121001006-120IF B4="",""IF B5="",""IF B6="",""IF B7="",""
61181001009-180IF J4,L4 AND N4=""IF H5, L5 AND N5=""IF H6,J6 AND N6=""IFJ7, J7 AND L7=""
712810010014-280THEN E4,F4 AND G4=""THEN D5,F5 AND G5="" THEN D6, E6 AND G6=""THEN D7,E7 AND F7=""
82172001001002.56-170AND D4=B4AND E5=N5/6*100AND F6=P6/9*100AND G7=R7/14*100
923020010010069-300
10246200100100914-460ROW 8ROW 9ROW 10ROW 11
112232001001002.59-230IF B8="",""IF B9="",""IF B10="",""IF B11="",""
122332001001002.514-330IF L8 AND N8=""IF H9 AND N9=""IF H10 AND J10=""IF J11 AND N11=""
133353001001001002.569-350THEN F8 AND G8 =""THEN D9 AND G9=""THEN D10 AND E10=""THEN E11 AND G11 =""
143583001001001006914-580AND D8=H8/2.5*100AND E9=J9/6*100AND F10=L10/9*100AND D11=H11/2.5*100
153513001001001002.5914-510ANDAND ANDAND
163453001001001002.5614-450F8=B8-D8G8=B9-E9G10=B10-F10F11=B11-D11
174634001001001001002.56914-630
18240200100100614-400ROW 12ROW 13ROW 14ROW 15
19IF B12="",""IF B13="",""IF B14="",""IF B15="",""
20I WILL TRY TO EXPLAIN MY PROBLEM AS SIMPLE AS POSSIBLEIF J12 AND L12=""IF N13=""IF H14=""IF J15=""
21If you change the amount in column B the difference amount in column Y should be zero onlyTHEN E12 AND F12 =""THAN G13=""THAN D14=""THAN E15=""
22I have given different formulas manually in columns D to KAND D12=H12/2.5*100THEN D13=H13/2.5*100AND E14=J14/6*100AND D15=H15/2.5*100
23There can be 15 different calculations for each amount entered in Column B ANDANDANDAND
24The number of entries are in 1000's. I have been calculating it manually for each row using sort and filter optionsG12=B12=D12E13=J13/6*100F14=L14/9*100F15=L15/9*100
25I know it is possible to make it easy by giving a formula in the Row 4 from D4:K4 in each column and copy the formula till the last entryANDANDAND
26Due to lack of knowledge of multiple "IF", "AND" & "OR", I am finding it difficult to solve this. I would like to know and understandF13=B13-H13-J13G14=B14-J14-L14G15=B15-D15-L15
27Since the last few weeks I have been trying but not able to solve it. I would really appreciate any help in solving this.
28Why don't you experts give it a try. If the solution is solved it will save me hours of workROW 16ROW 17ROW 18
29Please note that the amounts in columns H:P are also variables like in column BIF B16="",""IF B17="",""IF B18="",""
30Column C is an extension of my project and it will require to change only the references once I find a solutionIF J16=""IF H17, J17,L17 AND N17<>""IF H18 AND L18 =""
31How it worksTHEN F16=""THEN D17=H16/2.5*100THEN D18="", F18=""
32In columns H,J,L and N if there is amount in one cell only then it takes the amount from column BAND D16=H16/2.5*100AND E17=J17/6*100AND E18=J18/6*100
33if there are amounts in any 2 cells in H, J, L and N then the first cell in D, E, F and G should be calculated from the corresponding column ANDAND F17=L17/9*100AND G18=B18-E18
34and the second cell amount should be taken after deducting the total amount from the first calculated amountF16= L16/9*100AND G17=B17-D17-E17-F17
35if there are amounts in 3 cells the again the first cell amount should be calculated from the corresponding column AND
36the second amount also to be calculated from the corresponding columnG16=B16-D16-F16
37and then in the third cell it should deduct the total amount from the first and second calculation amounts
38if there are amounts in all 4 cells then the first cell amount should be calculated from the corresponding column
39the second cell amount also to be calculated from the corresponding column
40the third cell amount also to be calculated from the corresponding column
41and the fourth cell it should deduct the total amount from the first, second and third calculated amounts
42
43
44
45
QUERY
Cell Formulas
RangeFormula
D4D4=B4
P4:P18P4=B4+C4-SUM(D4:O4)
Q4:Q18Q4=A4-SUM(D4:O4)
E5E5=B5
F6F6=B6
G7G7=B7
D8,D15:D17,D11:D13D8=H8/2.5*100
E8E8=B8-D8
E9,E16:E17,E13:E14E9=J9/6*100
G10G10=B10-F10
F9F9=B9-E9
F10,F17,F14:F15F10=L10/9*100
F11F11=B11-D11
G12G12=B12-D12
F13F13=B13-D13-E13
G14G14=B14-E14-F14
G15G15=B15-D15-F15
G16G16=B16-D16-E16
A4:A17A4=SUM(C4:O4)
G17G17=B17-D17-E17-F17
 
Maabadi, I was going through the formula to understand it, which I always do to understand it and use that knowledge when and where ever required in future. But I just can't understand the head and tail of it. It's too advanced for me. The question I posted was only half of the full question. I thought if I got the correct answer I will be able to edit it and complete the other remaining half. But only you can help me to complete it as it is too complicated for me. If it's ok with you, can I re-post the whole question. It is just another additional 4 columns but with different taxes. Please reply and let me know. I bet this won't take more time as it is connected to the old formula. You will just have to add a few more conditions.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hey Fluff, I just wanted to ask you that whether I should post the question in a new post or can I post it here itself as it is connected to the question of this post.
 
Upvote 0
for your first uploaded file , one formula don't work because of circular refrences on column A.
Then I create 4 formula for 4 column:
D4:
Excel Formula:
=IF(ROW()-ROW($B$4)<4,IF($H4="","",$B4),IF($H4="","",$H4/2.5*100))
E4:
Excel Formula:
=IF(ROW()-ROW($B$4)<4,IF($J4="","",$J4/6*100),IF($D4<>"",IF($J4="","",IF(AND($L4="",$N4=""),$B4-IF($D4="",0,$D4),$J4/6*100)),IF($F4="",IF($J4="","",$J4/6*100))))
F4:
Excel Formula:
=IF(OR($D4<>"",$E4<>""),IF($L4="","",IF($N4="",$B4-IF($D4="",0,$D4)-IF($E4="",0,$E4),$L4/9*100)),IF(ROW()-ROW($B$4)<4,IF($L4="","",$B4),$L4/2.5*100))
G4:
Excel Formula:
=IF(AND(D4="",E4="",F4=""),IF($N4="","",$N4/14*100),IF(COLUMN()-COLUMN($B$4)=5,IF($N4="","",$B4-IF($D4="",0,$D4)-IF($E4="",0,$E4)-IF($F4="",0,$F4)),IF(ROW()-ROW($B$4)<4,IF($N4="","",$B4),$N4/14*100)))
 
Upvote 0
for your first uploaded file , one formula don't work because of circular refrences on column A.
Then I create 4 formula for 4 column:
D4:
Excel Formula:
=IF(ROW()-ROW($B$4)<4,IF($H4="","",$B4),IF($H4="","",$H4/2.5*100))
E4:
Excel Formula:
=IF(ROW()-ROW($B$4)<4,IF($J4="","",$J4/6*100),IF($D4<>"",IF($J4="","",IF(AND($L4="",$N4=""),$B4-IF($D4="",0,$D4),$J4/6*100)),IF($F4="",IF($J4="","",$J4/6*100))))
F4:
Excel Formula:
=IF(OR($D4<>"",$E4<>""),IF($L4="","",IF($N4="",$B4-IF($D4="",0,$D4)-IF($E4="",0,$E4),$L4/9*100)),IF(ROW()-ROW($B$4)<4,IF($L4="","",$B4),$L4/2.5*100))
G4:
Excel Formula:
=IF(AND(D4="",E4="",F4=""),IF($N4="","",$N4/14*100),IF(COLUMN()-COLUMN($B$4)=5,IF($N4="","",$B4-IF($D4="",0,$D4)-IF($E4="",0,$E4)-IF($F4="",0,$F4)),IF(ROW()-ROW($B$4)<4,IF($N4="","",$B4),$N4/14*100)))
The formula you sent earlier is perfect. I don't know why you changed the formula and this new formula doesn't work at all. I am getting a blank cell in all the cells. You can forget about the earlier question as it is solved.
 
Upvote 0
I am sending you a new file. Would like a single formula in H2 which I can drag it till O2 and drag the formula to the last cell.
If the column G is blank then it should take the formula from cells P R T and U, which you have already solved but there is an additional column with the heading Type B, which will change the whole range in your formula.

If the column G is not blank then it should take the formula from cells X Y Z and AA with different percentages 5%, 12%, 18% and 28 %

Please note that the percentages in the first half were 2.5%, 6%, 9% and 14%.

The amount in column F is divided in the columns H I J and K proportionately as per their percentage. At the same time, the amount in column G is divided in the columns L M N and O again as per their percentage.

In simple terms the amount in Column F = sum of columns H I J and K AND Column G is the sum of columns L M N and O.
full query.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
1DateParticularsNo.XYZGross TotalTYPE 1 SUB TOTALTYPE 2 SUB TOTALTYPE 1 -@ 5%TYPE 1 -@ 12%TYPE 1 -@ 18%TYPE 1 -@ 28%TYPE 2 @ 5%TYPE 2 @ 12%TYPE 2 @ 18%TYPE 2 @ 28%2.52.5669914145121828Round OffDiff
201-11-2020January1GHIJ1231930.001840.001840.0046.0046.00   -1842.000.00
302-11-2020February2ABCC12353528.003150.003150.00 189.00189.00  -3150.000.00
403-11-2020March312ABC2252622.002222.222222.22  200.00200.00 -2222.440.00
504-11-2020April4ABCD1033.00807.14807.14   113.00113.00-807.290.00
605-11-2020May53626.003310.001160.002150.0029.0029.00129.00129.00  -3310.000.00
706-11-2020June6BCDE5560.005191.434720.00471.43118.00118.00  66.0066.00-5190.860.00
807-11-2020July7CDEF3308.002773.811516.671257.14 91.0091.00 176.00176.00-2773.620.00
908-11-2020August8GHIJ1231993.001882.221760.00122.2244.0044.00 11.0011.00 -1881.440.00
1009-11-2020September92703.002188.89988.891200.00  89.0089.00168.00168.00-2188.780.00
1110-11-2020October1012ABC2259519.008754.444800.002783.331171.11120.00120.00167.00167.0091.0091.00 -8745.890.00
1211-11-2020November114125.003451.591383.33711.111357.14 83.0083.0064.0064.00190.00190.00-3452.170.00
1312-11-2020December123930.003541.902480.00333.33728.5762.0062.00 30.0030.00102.00102.00-3541.810.00
1413-11-2020January1312ABC2254158.003612.381360.00966.671285.7134.0034.0058.0058.00 180.00180.00-3610.760.00
1514-11-2020February14ABCD9239.008343.175240.00350.001788.89964.29131.00131.0021.0021.00161.00161.00135.00135.00-8343.350.00
1616-11-2020April16GHIJ1231930.001840.001840.0092.00   -1842.000.00
1717-11-2020May173528.003150.003150.00 378.00  -3150.000.00
1818-11-2020June1812ABC2252622.002222.222222.22  400.00 -2222.440.00
1919-11-2020July19ABCD1033.00807.14807.14   226.00-807.290.00
2020-11-2020August203626.003310.001160.002150.0058.00258.00  -3310.000.00
2121-11-2020September21BCDE5560.005191.434720.00471.43236.00  132.00-5190.860.00
2222-11-2020October22ABCC12353308.002773.811516.671257.14 182.00 352.00-2773.620.00
2323-11-2020November23GHIJ1231993.001882.221760.00122.2288.00 22.00 -1881.440.00
2424-11-2020December242703.002188.89988.891200.00  178.00336.00-2188.780.00
2525-11-2020January2512ABC2259519.008754.444800.002783.331171.11240.00334.00182.00 -8745.890.00
2626-11-2020February26GHIJ1234125.003451.591383.33711.111357.14 166.00128.00380.00-3452.170.00
2727-11-2020March27ABCC12353930.003541.902480.00333.33728.57124.00 60.00204.00-3541.810.00
2828-11-2020April2812ABC2254158.003612.381360.00966.671285.7168.00116.00 360.00-3610.760.00
2929-11-2020May29ABCD9239.008343.175240.00350.001788.89964.29262.0042.00322.00270.00-8343.350.00
New Query
Cell Formulas
RangeFormula
H2H2=F2
AB2:AB29AB2=E2-SUM(F2:AA2)
AC2:AC29AC2=E2-SUM(F2:AB2)
I3I3=F3
J4J4=F4
K5,L16K5=F5
I6I6=F6-H6
H13:H15,H11,H9,H6:H7H6=P6/2.5*100
I8,I14:I15,I11:I12I8=R8/6*100
K7K7=F7-H7
K8K8=F8-I8
K10K10=F10-J10
J9J9=F9-H9
J10,J15,J12:J13J10=T10/9*100
J11J11=F11-H11-I11
K12K12=F12-I12-J12
K13K13=F13-H13-J13
K14K14=F14-H14-I14
K15K15=F15-H15-I15-J15
W2:W15,U2:U15,S2:S15,Q2:Q15Q2=IF(P2="","",P2)
X16:X29X16=IFERROR(P2+Q2,"")
Y16:Y29Y16=IFERROR(S2+R2,"")
Z16:Z29Z16=IFERROR(T2+U2,"")
AA16:AA29AA16=IFERROR(W2+V2,"")
M17M17=G17
N18N18=G18
O19O19=G19
M20M20=G20-L20
L27:L29,L25,L23,L20:L21L20=X20/5*100
M22,M28:M29,M25:M26M22=Y22/12*100
O21O21=G21-L21
O22O22=G22-M22
O24O24=G24-N24
N23N23=G23-L23
N24,N29,N26:N27N24=Z24/18*100
N25N25=G25-L25-M25
O26O26=G26-M26-N26
O27O27=G27-L27-N27
O28O28=G28-L28-M28
O29O29=G29-L29-M29-N29
 
Upvote 0
I am sending you a new file. Would like a single formula in H2 which I can drag it till O2 and drag the formula to the last cell.
If the column G is blank then it should take the formula from cells P R T and U, which you have already solved but there is an additional column with the heading Type B, which will change the whole range in your formula.

If the column G is not blank then it should take the formula from cells X Y Z and AA with different percentages 5%, 12%, 18% and 28 %

Please note that the percentages in the first half were 2.5%, 6%, 9% and 14%.

The amount in column F is divided in the columns H I J and K proportionately as per their percentage. At the same time, the amount in column G is divided in the columns L M N and O again as per their percentage.

In simple terms the amount in Column F = sum of columns H I J and K AND Column G is the sum of columns L M N and O.
full query.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
1DateParticularsNo.XYZGross TotalTYPE 1 SUB TOTALTYPE 2 SUB TOTALTYPE 1 -@ 5%TYPE 1 -@ 12%TYPE 1 -@ 18%TYPE 1 -@ 28%TYPE 2 @ 5%TYPE 2 @ 12%TYPE 2 @ 18%TYPE 2 @ 28%2.52.5669914145121828Round OffDiff
201-11-2020January1GHIJ1231930.001840.001840.0046.0046.00   -1842.000.00
302-11-2020February2ABCC12353528.003150.003150.00 189.00189.00  -3150.000.00
403-11-2020March312ABC2252622.002222.222222.22  200.00200.00 -2222.440.00
504-11-2020April4ABCD1033.00807.14807.14   113.00113.00-807.290.00
605-11-2020May53626.003310.001160.002150.0029.0029.00129.00129.00  -3310.000.00
706-11-2020June6BCDE5560.005191.434720.00471.43118.00118.00  66.0066.00-5190.860.00
807-11-2020July7CDEF3308.002773.811516.671257.14 91.0091.00 176.00176.00-2773.620.00
908-11-2020August8GHIJ1231993.001882.221760.00122.2244.0044.00 11.0011.00 -1881.440.00
1009-11-2020September92703.002188.89988.891200.00  89.0089.00168.00168.00-2188.780.00
1110-11-2020October1012ABC2259519.008754.444800.002783.331171.11120.00120.00167.00167.0091.0091.00 -8745.890.00
1211-11-2020November114125.003451.591383.33711.111357.14 83.0083.0064.0064.00190.00190.00-3452.170.00
1312-11-2020December123930.003541.902480.00333.33728.5762.0062.00 30.0030.00102.00102.00-3541.810.00
1413-11-2020January1312ABC2254158.003612.381360.00966.671285.7134.0034.0058.0058.00 180.00180.00-3610.760.00
1514-11-2020February14ABCD9239.008343.175240.00350.001788.89964.29131.00131.0021.0021.00161.00161.00135.00135.00-8343.350.00
1616-11-2020April16GHIJ1231930.001840.001840.0092.00   -1842.000.00
1717-11-2020May173528.003150.003150.00 378.00  -3150.000.00
1818-11-2020June1812ABC2252622.002222.222222.22  400.00 -2222.440.00
1919-11-2020July19ABCD1033.00807.14807.14   226.00-807.290.00
2020-11-2020August203626.003310.001160.002150.0058.00258.00  -3310.000.00
2121-11-2020September21BCDE5560.005191.434720.00471.43236.00  132.00-5190.860.00
2222-11-2020October22ABCC12353308.002773.811516.671257.14 182.00 352.00-2773.620.00
2323-11-2020November23GHIJ1231993.001882.221760.00122.2288.00 22.00 -1881.440.00
2424-11-2020December242703.002188.89988.891200.00  178.00336.00-2188.780.00
2525-11-2020January2512ABC2259519.008754.444800.002783.331171.11240.00334.00182.00 -8745.890.00
2626-11-2020February26GHIJ1234125.003451.591383.33711.111357.14 166.00128.00380.00-3452.170.00
2727-11-2020March27ABCC12353930.003541.902480.00333.33728.57124.00 60.00204.00-3541.810.00
2828-11-2020April2812ABC2254158.003612.381360.00966.671285.7168.00116.00 360.00-3610.760.00
2929-11-2020May29ABCD9239.008343.175240.00350.001788.89964.29262.0042.00322.00270.00-8343.350.00
New Query
Cell Formulas
RangeFormula
H2H2=F2
AB2:AB29AB2=E2-SUM(F2:AA2)
AC2:AC29AC2=E2-SUM(F2:AB2)
I3I3=F3
J4J4=F4
K5,L16K5=F5
I6I6=F6-H6
H13:H15,H11,H9,H6:H7H6=P6/2.5*100
I8,I14:I15,I11:I12I8=R8/6*100
K7K7=F7-H7
K8K8=F8-I8
K10K10=F10-J10
J9J9=F9-H9
J10,J15,J12:J13J10=T10/9*100
J11J11=F11-H11-I11
K12K12=F12-I12-J12
K13K13=F13-H13-J13
K14K14=F14-H14-I14
K15K15=F15-H15-I15-J15
W2:W15,U2:U15,S2:S15,Q2:Q15Q2=IF(P2="","",P2)
X16:X29X16=IFERROR(P2+Q2,"")
Y16:Y29Y16=IFERROR(S2+R2,"")
Z16:Z29Z16=IFERROR(T2+U2,"")
AA16:AA29AA16=IFERROR(W2+V2,"")
M17M17=G17
N18N18=G18
O19O19=G19
M20M20=G20-L20
L27:L29,L25,L23,L20:L21L20=X20/5*100
M22,M28:M29,M25:M26M22=Y22/12*100
O21O21=G21-L21
O22O22=G22-M22
O24O24=G24-N24
N23N23=G23-L23
N24,N29,N26:N27N24=Z24/18*100
N25N25=G25-L25-M25
O26O26=G26-M26-N26
O27O27=G27-L27-N27
O28O28=G28-L28-M28
O29O29=G29-L29-M29-N29
Please note that only either of the columns F or G will have a value in each row. If one is empty the other will have a value.
 
Upvote 0
For Now, Please Use this 2 formula. I work on one formula.
For Column H to K (insert at H2):
Excel Formula:
=IF(AND(COLUMN()-COLUMN($F$2)=5,G2="",E2="",F2=""),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/14*100),IF(COLUMN()-COLUMN($F$2)=5,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-3))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-3)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-2))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-2)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-1))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-1)))),IF(AND(COLUMN()-COLUMN($F$2)=4,OR(F2<>"",G2<>"")),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()+2))=0,$F2-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-2))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-2)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-1))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-1))),INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100)),IF(AND(COLUMN()-COLUMN($F$2)=3,G2<>""),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(AND(INDIRECT(ADDRESS(ROW(),2*COLUMN()+2))=0,INDIRECT(ADDRESS(ROW(),2*COLUMN()+4))=0),$F2-$H2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100)),IF(ROW()-ROW($F$2)<4,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COLUMN()-COLUMN($F$2)=4,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,IF(COLUMN()-COLUMN($F$2)=3,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/2.5*100))))))))
For Column L to O (Insert at L2):
Excel Formula:
=IF($G2="","",IF(COUNT($X2:$AA2)=1,IF(X2="","",$G2),IF(COLUMN()-COLUMN($L$2)=3,IF(COUNT(U2:W2)>0,IF(X2="","",$G2-IF(I2="",0,I2)-IF(J2="",0,J2)-IF(K2="",0,K2)),IF(COUNT(U2:W2)=0,$G2)),IF(COLUMN()-COLUMN($L$2)=0,IF(X2="","",X2/5*100),IF(COLUMN()-COLUMN($L$2)=1,IF(W2="",IF(X2="","",X2/12*100),IF(X2="","",IF(COUNT(X2:Z2)>1,X2/12*100,$G2-IF(K2="",0,K2)))),IF(COLUMN()-COLUMN($L$2)=2,IF(AND(V2="",W2=""),IF(COUNT(X2:Y2)>1,X2/18*100,$G2-IF(J2="",0,J2)-IF(K2="",0,K2)),IF(X2="","",IF(COUNT(X2:Y2)>1,X2/18*100,$G2-IF(J2="",0,J2)-IF(K2="",0,K2))))))))))
 
Upvote 0
For Now, Please Use this 2 formula. I work on one formula.
For Column H to K (insert at H2):
Excel Formula:
=IF(AND(COLUMN()-COLUMN($F$2)=5,G2="",E2="",F2=""),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/14*100),IF(COLUMN()-COLUMN($F$2)=5,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-3))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-3)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-2))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-2)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-1))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-1)))),IF(AND(COLUMN()-COLUMN($F$2)=4,OR(F2<>"",G2<>"")),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()+2))=0,$F2-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-2))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-2)))-IF(INDIRECT(ADDRESS(ROW(),COLUMN()-1))="",0,INDIRECT(ADDRESS(ROW(),COLUMN()-1))),INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100)),IF(AND(COLUMN()-COLUMN($F$2)=3,G2<>""),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(AND(INDIRECT(ADDRESS(ROW(),2*COLUMN()+2))=0,INDIRECT(ADDRESS(ROW(),2*COLUMN()+4))=0),$F2-$H2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100)),IF(ROW()-ROW($F$2)<4,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COLUMN()-COLUMN($F$2)=4,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,IF(COLUMN()-COLUMN($F$2)=3,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/2.5*100))))))))
For Column L to O (Insert at L2):
Excel Formula:
=IF($G2="","",IF(COUNT($X2:$AA2)=1,IF(X2="","",$G2),IF(COLUMN()-COLUMN($L$2)=3,IF(COUNT(U2:W2)>0,IF(X2="","",$G2-IF(I2="",0,I2)-IF(J2="",0,J2)-IF(K2="",0,K2)),IF(COUNT(U2:W2)=0,$G2)),IF(COLUMN()-COLUMN($L$2)=0,IF(X2="","",X2/5*100),IF(COLUMN()-COLUMN($L$2)=1,IF(W2="",IF(X2="","",X2/12*100),IF(X2="","",IF(COUNT(X2:Z2)>1,X2/12*100,$G2-IF(K2="",0,K2)))),IF(COLUMN()-COLUMN($L$2)=2,IF(AND(V2="",W2=""),IF(COUNT(X2:Y2)>1,X2/18*100,$G2-IF(J2="",0,J2)-IF(K2="",0,K2)),IF(X2="","",IF(COUNT(X2:Y2)>1,X2/18*100,$G2-IF(J2="",0,J2)-IF(K2="",0,K2))))))))))
Thanks Maabadi. You just saved me hours of work. Now I can finish it in less than a minute. And concentrate on thinking of creating more new ideas. ☺
 
Upvote 0
About one formula, I have Problem with Circular References.
Also for Column H to K, you can use this formula:
Excel Formula:
=IF($F2="","",IF(COUNT($P2:$W2)=2,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2),IF(COLUMN()-COLUMN($H$2)=3,IF(COUNT($P2:$U2)>0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2-IF(E2="",0,E2)-IF(F2="",0,F2)-IF(G2="",0,G2)),IF(COUNT($P2:$U2)=0,$F2)),IF(COLUMN()-COLUMN($H$2)=0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/2.5*100),IF(COLUMN()-COLUMN($H$2)=1,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()-2))=0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COUNT($R2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100,$F2-IF(G2="",0,G2)))),IF(COLUMN()-COLUMN($H$2)=2,IF(AND(INDIRECT(ADDRESS(ROW(),2*COLUMN()-4))=0,INDIRECT(ADDRESS(ROW(),2*COLUMN()-2))=0),IF(COUNT($T2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,$F2-IF(F2="",0,F2)-IF(G2="",0,G2)),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COUNT($T2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,$F2-IF(F2="",0,F2)-IF(G2="",0,G2))))))))))
 
Upvote 0
About one formula, I have Problem with Circular References.
Also for Column H to K, you can use this formula:
Excel Formula:
=IF($F2="","",IF(COUNT($P2:$W2)=2,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2),IF(COLUMN()-COLUMN($H$2)=3,IF(COUNT($P2:$U2)>0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",$F2-IF(E2="",0,E2)-IF(F2="",0,F2)-IF(G2="",0,G2)),IF(COUNT($P2:$U2)=0,$F2)),IF(COLUMN()-COLUMN($H$2)=0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/2.5*100),IF(COLUMN()-COLUMN($H$2)=1,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()-2))=0,IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COUNT($R2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/6*100,$F2-IF(G2="",0,G2)))),IF(COLUMN()-COLUMN($H$2)=2,IF(AND(INDIRECT(ADDRESS(ROW(),2*COLUMN()-4))=0,INDIRECT(ADDRESS(ROW(),2*COLUMN()-2))=0),IF(COUNT($T2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,$F2-IF(F2="",0,F2)-IF(G2="",0,G2)),IF(INDIRECT(ADDRESS(ROW(),2*COLUMN()))=0,"",IF(COUNT($T2:$W2)>2,INDIRECT(ADDRESS(ROW(),2*COLUMN()))/9*100,$F2-IF(F2="",0,F2)-IF(G2="",0,G2))))))))))
You should change the beginning of the code I think. =IF($F2="","",....
If $F2="",then take the value from $G2 and apply the formula, then take the value from $F2 and apply the formula.
I will give it a try and let you know if it worked. Your 2 different formulas concept also is working.
 
Upvote 0

Forum statistics

Threads
1,215,892
Messages
6,127,610
Members
449,389
Latest member
ChessManNaill

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