Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9831

Formula error - Column result based on multiple rows values

$
0
0

The known: -Column A - Tenant, Column B - Flat no., Column C - Duration stayed, Column D - Energy consumed in flat.

To find out:-Column E - Energy consumed per tenant.

Condition,I have to consider the unique value of A as an identifier in order to avoid duplicate results/error in calculations.

Example - 4 people A2:A5 stay in the same flat B2:B5, they have consumed 85KW "D" in 30 days "C"

Simple Formula: =D2/SUM(C2:C5)*C2 (Manual process as per every flat)

Forumula to automate: =IF(COUNTIF($A$2:A2,A2)=1,D2/SUMIF($B$2:$B$44,B2,$C$2:$C$44)*C2,"")However this formula is wrong because it gives correct value till a certain range, if I increase the range for B column, the result value changes and it becomes incorrect.

Can someone help me with this please?

Thank you.

Dummy sheet link - https://www.dropbox.com/scl/fi/dc8jvqlqfq9ozge7iyuiz/Dummy.xlsx?dl=0&rlkey=1fpsgjybibsneblydqc1kusz1

Ref. image-1

Ref. image-2


Viewing all articles
Browse latest Browse all 9831

Latest Images

Trending Articles



Latest Images