writing a customised UDF like SUMIFS

Qroozn

Well-known Member
Joined
Mar 12, 2002
Messages
543
Hey everyone.
I have been trying to utilise the SUMIFS function, but have found it is limited in achieving what I want (e.g. - I have 8 conditions - and i think SUMIFS only does upto 5, and i also want to have a sub CONDITION to each condition).
e.g. I only want condition 1 to run if $A$1 (on the current page) <> 1, and i only want condition 2 to run if $A$2 (on the current page) <> 1.

I think the best solution is to write a UDF that i could build this logic into.

has anyone got a UDF that would replicate the current SUMIFS function that i could modify to handle my enhancements?

Thanks in advance.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I have 8 conditions - and i think SUMIFS only does upto 5
You can have up to 127 conditions. For 'sub conditions' as you call them, you probably just need to use IF in the SUMIFS criteria.

For example, this would sum column A if column B = "Qroozn" and $A$1<>1. IF $A$1=1 then it will sum with anything in column B

=SUMIFS(Sheet2!A:A,Sheet2!B:B,IF($A$1<>1,"Qroozn","*"))

The method for the last part varies depending on the criteria, text and numbers need to be handled differently, possibly blank and empty cells would as well.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,577
Members
449,039
Latest member
Arbind kumar

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