Shorten a formula

AjayGunware

New Member
Joined
Dec 13, 2016
Messages
3
hi folks, will it be possible please to help in shortening or suggesting an alternative formula so that it can account for at least 100 rows for the below calculation of Burgers per Person ?

CityBurgersPeople
A105
B 10
C204
D306
Total6015
Ratio 4

<tbody>
</tbody><colgroup><col span="3"></colgroup>

To calculate Total people, I have used below formula as I need to consider only those people where a number is present under Burger column.

=SUM(IF(ISNUMBER(B2),C2,"0"),IF(ISNUMBER(B3),C3,"0"),IF(ISNUMBER(B4),C4,"0"),IF(ISNUMBER(B5),C5,"0"))

I feel it is easy for just 4 rows but this might become a tedious formula for 100 rows ! please help....

Regards,
Ajay Gunware
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

CsJHUN

Active Member
Joined
Jan 13, 2015
Messages
360
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. Mobile
Hi, welcome a-board!

Did you tried/thinked/have experience with pivots?
 
Upvote 0

arthurbr

Well-known Member
Joined
Dec 8, 2006
Messages
2,597
Office Version
  1. 365
  2. 2010
Alternatively = sumif(b2:b100,">0",c2:c100)
adapt your range as needed
 
Upvote 0

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,476
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
extend the ranges to suit

=SUMIF(B2:B5,">0",C2:C5)
 
Upvote 0

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,840
ADVERTISEMENT
Would such entries be valid:
Burgers...0 People...10
Burgers...1 People...10?
 
Upvote 0

AjayGunware

New Member
Joined
Dec 13, 2016
Messages
3
Hi Tetra201, I had replaced real parameters with dummy values for the sake of putting example and for ensuring clarity in my question. thank you :)
 
Upvote 0

Forum statistics

Threads
1,195,990
Messages
6,012,723
Members
441,722
Latest member
tpaman1975

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