SUM,COUNTA - Data Validation

Amr Fekry

New Member
Joined
Oct 30, 2010
Messages
5
Hello all :)

I've a problem .. I'm not sure if there's a solution

let's assume that I have 5 cells (A1-A5)
and in cell (A6) I used (SUM) equation to sum total value in (A1-A5)
Code:
=SUM(A1:A5)
in cell (B6) I have a (COUNTA) function .. to count cells which contain any entered value in a range of (B1-B5)
Code:
=COUNTA(B1:B5)
2j44r4x.jpg



let's say that I have a result of summed data in (A6) which is (3)
I used (Data Validation) to make it tell me when counted data in (B6) exceeds the summed data in (A6)
Code:
=COUNTA($B$1:$B$5)<=$A$6
347v512.jpg



with conditional formatting for (B6) when it exceeds (A6).


I copied what I've done in other cells


2hp7lmo.jpg



All (Data Validation) custom formulas I made have worked

Code:
=COUNTA($B$1:$B$5)<=$A$6

=COUNTA($E$1:$E$5)<=$D$6

=COUNTA($H$1:$H$5)<=$G$6

=COUNTA($K$1:$K$5)<=$J$6
But I failed to make it with my main request from all of this

In the orange filled cell with thick borders (F9) I've sum of the four counted cells B6, E6, H6, K6)
Code:
=SUM(B6;E6;H6;K6)
And I want to use (Data Validation) to make sure that it never exceeds a specific limit .. let's say (14)

so,
I want to sum the four cells which contains (COUNTA) function in Cell (F9)
and I want to use (Data Validation) to ensure that the result never exceeds (14)!


Can anyone help me?


Thanks a lot
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Not entirely clear but perhaps a Validation rule along the lines of the below for B1:B5:

Code:
=(B$6<=A$6)*(SUM($B$6,$E$6,$H$6,$K$6)<=14)

Validation rule subsequently applied to D, G, K (or at once if preferred)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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