Sumif formula

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,501
Office Version
  1. 2016
Platform
  1. Windows
Hi Everyone

I need some formula for the below mention Data

Sheet1 Name = DATA
Sheet2 Name = REPORTS

DATA

ABCDEFGHIJK
5CLIENTPage #File #DATEUnitP/UnitStock STOCK IN STOCK OUT CLOSING Stock Rent
6Star Plastic1015-Sep-10Bags2.00 - 664 - 664 1,328
7Star Plastic1015-Sep-10Bags2.00 664 - 664 -
8
9Adnan Data2015-Sep-10Bags2.00 - 7,920 - 7,920 15,840
10Adnan Data2015-Sep-10Bags2.00 7,920 - 200 7,720
11Adnan Data2021-Sep-10Bags2.00 7,720 - 100 7,620
12Adnan Data2024-Sep-10Bags2.00 7,620 - 250 7,370
13Adnan Data2025-Sep-10Bags2.00 7,370 - 250 7,120
14Adnan Data2028-Sep-10Bags2.00 7,120 - 50 7,070
15Adnan Data2015-Oct-10Bags2.00 7,070 - - 7,070 14,140
16Adnan Data2015-Oct-10Bags2.00 7,070 - 55 7,015
17Adnan Data2023-Oct-10Bags2.00 7,015 - 50 6,965
18Adnan Data2028-Oct-10Bags2.00 6,965 - 50 6,915
19Adnan Data2030-Oct-10Bags2.00 6,915 - 100 6,815
20Adnan Data2004-Nov-10Bags2.00 6,815 - 195 6,620

<COLGROUP> <COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 87px"><COL style="WIDTH: 44px"><COL style="WIDTH: 37px"><COL style="WIDTH: 70px"><COL style="WIDTH: 45px"><COL style="WIDTH: 74px"><COL style="WIDTH: 64px"><COL style="WIDTH: 68px"><COL style="WIDTH: 80px"><COL style="WIDTH: 101px"><COL style="WIDTH: 75px"> </COLGROUP><TBODY>
</TBODY>




REPORTS

BC
3ACCOUNT STATEMENT
4
5CLIENTFaheem Traders
6
7
8STOCKSDATES
9Start18-Nov-11
10End29-May-13
11
12
13
14STOCKSQUANTITY
15In 9,067
16Out 8,794
17Balance 273
18
19
20
21RENTAMOUNT
22Charged 185,220
23Received -
24Balance 185,220

<COLGROUP> <COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 103px"><COL style="WIDTH: 201px"> </COLGROUP><TBODY>
</TBODY>

Spreadsheet Formulas
CellFormula
C9{=MIN(IF((DATA!$A$6:$A$10000=$C$5),IF(ISNUMBER(DATA!$D$6:$D$10000),DATA!$D$6:$D$10000)))}
C10{=MAX(IF((DATA!$A$6:$A$10000=$C$5),IF(ISNUMBER(DATA!$D$6:$D$10000),DATA!$D$6:$D$10000)))}
C15{=SUM(IF(DATA!$A$6:$A$10000=$C$5,DATA!$H$6:$H$10000,0))}
C16{=SUM(IF(DATA!$A$6:$A$10000=$C$5,DATA!$I$6:$I$10000,0))}
C17=+C15-C16
C22{=SUM(IF(DATA!$A$6:$A$10000=$C$5,DATA!$K$6:$K$10000,0))}
C24=+C22-C23

<TBODY>
</TBODY>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<TBODY>
</TBODY>


When i enter a client in cell C5 then the dates, Stock in out and rent cells are showing perfect results.. What i need is when i enter "ALL" in cell C5 then it should show the total data present in the DATA sheet

Hope anyone can help

Regards,

Humayun
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I tried it with adding an OR($C$5="All",

for example, C16:

=SUM(IF(OR($C$5="All",DATA!$A$6:$A$10000=$C$5),DATA!$I$6:$I$10000,0))
 
Upvote 0
Thanks Lxq for your reply

i found one myself which is a bit lengthy

=SUM(IF(DATA!$B$6:$B$10000=$C$5,IF(DATA!$F$6:$F$10000=D$9,IF(DATA!$E$6:$E$10000>=$K$5,IF(DATA!$E$6:$E$10000<=$K$6,DATA!$I$6:$I$10000)))),SUM(IF(DATA!$A$6:$A$10000=$C$5,IF(DATA!$F$6:$F$10000=D$9,IF(DATA!$E$6:$E$10000>=$K$5,IF(DATA!$E$6:$E$10000<=$K$6,DATA!$I$6:$I$10000))))))
679,020

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
 
Upvote 0
Thanks Lxq for your reply

i found one myself which is a bit lengthy

=SUM(IF(DATA!$B$6:$B$10000=$C$5,IF(DATA!$F$6:$F$10000=D$9,IF(DATA!$E$6:$E$10000>=$K$5,IF(DATA!$E$6:$E$10000<=$K$6,DATA!$I$6:$I$10000)))),SUM(IF(DATA!$A$6:$A$10000=$C$5,IF(DATA!$F$6:$F$10000=D$9,IF(DATA!$E$6:$E$10000>=$K$5,IF(DATA!$E$6:$E$10000<=$K$6,DATA!$I$6:$I$10000))))))
679,020

<tbody>
</tbody>

Shouldn't that be just...

=SUM(IF(DATA!$B$6:$B$10000=$C$5,IF(DATA!$F$6:$F$10000=D$9,IF(DATA!$E$6:$E$10000>=$K$5,IF(DATA!$E$6:$E$10000<=$K$6,DATA!$I$6:$I$10000))))

appropriate or not for the task at hand?
 
Upvote 0

Forum statistics

Threads
1,215,153
Messages
6,123,325
Members
449,097
Latest member
gameover8

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