Complex if/iferror formula

RattlingCarp3048

Board Regular
Joined
Jan 12, 2022
Messages
166
Office Version
  1. 365
Platform
  1. Windows
HELP... i need to make a formula that is a bit more complex than I am used to. if there is a much simpler way than my initial approach i am open to alternative methods.

Columns F, H, and N each contain their own formula. They either result in a number or a "-" as a result of an error.

I need Column P to = F+H+N.

If Column B = "IHC" then calculate F+(H*3)+N instead.

If any one or combination of F, H, or N = "-" calculate the others instead. For instance

If B = IHC then calculate F+H*3+N otherwise calculate base

If B = IHC then calculate F+H*3+N

If F = - then calculate H+N

If H = - then calculate F+N

If N = - then calculate F+H

If F+H = - then calculate N

If F+N = - then calculate H

If H+N= - then calculate F

If B = IHC then calculate H+N

If B = IHC then calculate H+N etc...
 
Understood. Try this instead

Book1.xlsx
BFHNP
1
2IHC---0
3Meat32.0--32
4Veggies-15-15
5IHC23.03412137
6Veggies1515
7Veggies243256
Sheet1
Cell Formulas
RangeFormula
P2:P7P2=IF(AND(B2="IHC",ISNUMBER(H2)),(H2*3)+SUM(F2)+SUM(N2),SUM(F2)+SUM(H2)+SUM(N2))
There we go! looks like that was it. Whew. i never would have gotten that on my own. Question: i tried a variation of the Sum function to no avail. in this particular format why would simply stating P=F2+H2+N2 not work? is it because the =sum is looking for the specific value of each cell?
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
There we go! looks like that was it. Whew. i never would have gotten that on my own. Question: i tried a variation of the Sum function to no avail. in this particular format why would simply stating P=F2+H2+N2 not work? is it because the =sum is looking for the specific value of each cell?

It's because Excel's Sum() Function ignores text.
 
Upvote 0
Sorry I wasnt more clear. Here is a sample picture of data. Names and titles changed for confidentiality. F,H,N are different departments. Each employee has a primary department they are assigned to but some are cross-trained to work in other areas. so the data per person is constantly changing between the columns. Basically what i am trying to do is add the columns that do have data and ignore the ones that are "-". The dashes do not represent 0. Columns F, H, N each have their own individual formulas in them that state if the return value is 0 or error, show a dash instead. This is just to help keep the sheet cleaner in appearance.
Did you try the formula from post #5?
Meets all your specifications.

varios 28ene2022.xlsm
ABFHNP
1
2IHC-40-120
3Meat32--32
4Veggies-15-15
5IHC233412137
6Veggies1515
7Veggies243256
Hoja3
Cell Formulas
RangeFormula
P2:P7P2=SUM(F2,N(H2)*IF(B2="IHC",3,1),N2)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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