2 IF statements needed? , lots of conditions help

darkbluecat

New Member
Joined
Jan 7, 2021
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Okay so the first IF statement works:

IF($E$1<>"none",SUMIFS(Raw!$AF:$AF,Raw!$R:$R,'Emission factors'!$C5,Raw!$D:$D,'Emission factors'!E$4,Raw!$W:$W,'Emission factors'!$E$1,Raw!$A:$A,'Emission factors'!$G$1),SUMIFS(Raw!$AF:$AF,Raw!$R:$R,'Emission factors'!$C5,Raw!$D:$D,'Emission factors'!E$4,Raw!$A:$A,'Emission factors'!$G$1)))

Where "none" is when no date is selected from a drop down. Raw refers to the raw data sheet, emissions factors is the sheet I'm working on. Now the last condition for each sumifs refers to the second drop down I've made next to the date drop down, referring to the 4 categories the data is in which is in a column in the raw data tab: this works with each of the 4 categories.

- now I have a fifth category in the drop down which is "All", similar to the "none" date selection where it returns all, for example if I chose none for the date selection and all for the category it would give me each of the things in the raw data I'm summing. - my question is how would I add this into the calculation above?

can't provide any more info as it's for work but the above calculation does work for the categories just need the values to return all in case "All" categories are selected where no specific category is selected. Colour coded text for what the calc is referring to. I just need an option in case "All" is selected rather than a specific category.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,671
Office Version
  1. 365
Platform
  1. MacOS
OK
please come back if needed
perhaps with the conditions - if thats all you have

Something like

E1 = "NONE" G1="ALL" = Formula1

E1 = "NONE" G1= anything = Formula2

E1 = anything G1="ALL" = Formula3

E1 = anything G1=anything = Formula4
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Watch MrExcel Video

Forum statistics

Threads
1,129,793
Messages
5,638,359
Members
417,023
Latest member
Zimbo38

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
Top