Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bruce
 
Posts: n/a
Default Sumif with a twist?

43975000 50
43865000 100
43828000 5
43828001 21

Assume the block of data above, and that I want to do a sumif formula, with
the range being the 1st column, but only the first 5 characters of said cells
in the range. Example, the criteria will be 43828 and I want the result to be
the value 26. The reason is this is a basically a rollup of values in column
B when the match is on the first 5 characters.

Does this make sense?

Thanks,
  #2   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

If the figures in A2:A10 are true numbers and F2 houses the number 43828:

=SUMPRODUCT(--(LEFT($A$2:$A$10&"00000",5)+0=F2),$B$2:$B$10)

If the figures in A2:A10 are text-formatted number and F2 as befo

=SUMIF($A$2:$A$10,F2&"*",$B$2:$B$10)

Bruce wrote:
43975000 50
43865000 100
43828000 5
43828001 21

Assume the block of data above, and that I want to do a sumif formula, with
the range being the 1st column, but only the first 5 characters of said cells
in the range. Example, the criteria will be 43828 and I want the result to be
the value 26. The reason is this is a basically a rollup of values in column
B when the match is on the first 5 characters.

Does this make sense?

Thanks,


--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use SUMIF to return sums between two values located in cells ScottBerger Excel Worksheet Functions 2 April 23rd 23 09:05 PM
How do I use the sumif if I have multiple criteria (i.e. greater . Kellyatisl Excel Worksheet Functions 3 June 4th 06 06:33 AM
SUMIF with Mutiple Ranges & Criteria PokerZan Excel Discussion (Misc queries) 5 August 4th 05 10:31 PM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM
SUM(IF( Array to avoid #NUM! values Elijah Excel Worksheet Functions 7 November 21st 04 02:17 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"