ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I use sumif and mid function in same formula (https://www.excelbanter.com/excel-worksheet-functions/151191-how-do-i-use-sumif-mid-function-same-formula.html)

Vrajesh Saraiya

How do I use sumif and mid function in same formula
 
I am trying to find a solution to sum values in a column range when the value
derived by using mid function in another column range matches with the value
stores in a cell. To illustrate
A B
1 A1 10
2 A2 12
3 B1 20
4 B2 21
5
6 A 22
7 B 41

I want to total all values of range B1:B4 when value in range A1:A4 (derived
by using MID function) mataches with value in cell A6 or A7 (the first letter
of each alphanumeric value).

If this is not the correct way to arrive at the result, suggestions on
alternative way will be appreciated.

Dave Peterson

How do I use sumif and mid function in same formula
 
I'm kind of confused, but if you want to sum the values in B1:B4 where the first
letter in A1:A4 matches what's in A6, you could use:

=sumif(a1:a4,a6&"*",b1:b4)


Vrajesh Saraiya wrote:

I am trying to find a solution to sum values in a column range when the value
derived by using mid function in another column range matches with the value
stores in a cell. To illustrate
A B
1 A1 10
2 A2 12
3 B1 20
4 B2 21
5
6 A 22
7 B 41

I want to total all values of range B1:B4 when value in range A1:A4 (derived
by using MID function) mataches with value in cell A6 or A7 (the first letter
of each alphanumeric value).

If this is not the correct way to arrive at the result, suggestions on
alternative way will be appreciated.


--

Dave Peterson

Teethless mama

How do I use sumif and mid function in same formula
 
=SUMPRODUCT(--(LEFT(A1:A4,1)="A"),B1:B4)


"Vrajesh Saraiya" wrote:

I am trying to find a solution to sum values in a column range when the value
derived by using mid function in another column range matches with the value
stores in a cell. To illustrate
A B
1 A1 10
2 A2 12
3 B1 20
4 B2 21
5
6 A 22
7 B 41

I want to total all values of range B1:B4 when value in range A1:A4 (derived
by using MID function) mataches with value in cell A6 or A7 (the first letter
of each alphanumeric value).

If this is not the correct way to arrive at the result, suggestions on
alternative way will be appreciated.



All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com