Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default test if a logical statement and use the answer within an if statem

How can I use the Find function within an array formula to check a column to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 457
Default test if a logical statement and use the answer within an if statem

Something like this:

=SUMPRODUCT(--(ISNUMBER(FIND("MyString",A2:A100))),B2:B100)

or the non-case sensitive version:

=SUMPRODUCT(--(ISNUMBER(SEARCH("MyString",A2:A100))),B2:B100)

--
Best Regards,

Luke M
"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a column
to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default test if a logical statement and use the answer within an if statem

If I understand what you are trying to do, I think the SUMIF function is
what you will want to use. Assuming Column A has your strings to be searched
and Column B has your numbers to be summed (just change the ranges as
required; you can specify a larger range than your current data set if you
will adding new data in the future)...

=SUMIF(A1:A1000,"Some string value",B1:B1000)

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a column
to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default test if a logical statement and use the answer within an if statem

Hi,
I assume you look for letter a so try, enter formula as an array

Ctrl + Shift + Enter , it will put {} at the beginning and at the end

=SUM(IF(A8:A11="a",B8:B11))

"BG Mark" wrote:

How can I use the Find function within an array formula to check a column to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default test if a logical statement and use the answer within an if statem

Say we are searching for "happiness" in column A and want to sum the
corresponding values in column B:

=SUMPRODUCT(--(LEN(SUBSTITUTE(A1:A100,"happiness",""))<LEN(A1:A 100))*(B1:B100))

so:

happiness is good 1
happiness is over-rated 13
sadness should be avoided 37

will return a 14
--
Gary''s Student - gsnu201001


"BG Mark" wrote:

How can I use the Find function within an array formula to check a column to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default test if a logical statement and use the answer within an if statem

My previous post gave you the method to SUMIF for an exact match... if you
need to do a partial match, then just use the asterisk wildcard on either
side of the text you are searching for...

=SUMIF(A1:A1000,"*partial match me*",B1:B1000)

Note the asterisks on either end of the to-be-searched-for string... the
above will sum up the values in Column B for any cell in Column A that
contains the text "partial match me" either in whole or within a larger text
string containing that text.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
If I understand what you are trying to do, I think the SUMIF function is
what you will want to use. Assuming Column A has your strings to be
searched and Column B has your numbers to be summed (just change the
ranges as required; you can specify a larger range than your current data
set if you will adding new data in the future)...

=SUMIF(A1:A1000,"Some string value",B1:B1000)

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a column
to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 457
Default test if a logical statement and use the answer within an if statem

As Rick points out, SUMIF can use wildcards (something I had forgotten),
thus his solution is better.

--
Best Regards,

Luke M
"Luke M" wrote in message
...
Something like this:

=SUMPRODUCT(--(ISNUMBER(FIND("MyString",A2:A100))),B2:B100)

or the non-case sensitive version:

=SUMPRODUCT(--(ISNUMBER(SEARCH("MyString",A2:A100))),B2:B100)

--
Best Regards,

Luke M
"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a column
to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default test if a logical statement and use the answer within an if st

Firstly thanks to all who replied, but I have an additional problem.

Column A has the data that I am searching for, and the SUMIF would work
ideally if all the corresponding values in column be were of the same format,
however column B will contain either 1, A, D or blank and I need also to add
1 to the total for every occurence of value A.

eg
Column A Column B
Mech Shift 1 1
Inst Shift 1 1
Elec Shift 1 1
Mech Shift 2 A
Mech Shift 3 D

I need a formula that will serch for every occurence of Mech in column A and
count only the 1's and A's in column B, so in the above case the total should
be 2.
In case anyone is wondering, A and D stand for arrival and departure.

"Rick Rothstein" wrote:

My previous post gave you the method to SUMIF for an exact match... if you
need to do a partial match, then just use the asterisk wildcard on either
side of the text you are searching for...

=SUMIF(A1:A1000,"*partial match me*",B1:B1000)

Note the asterisks on either end of the to-be-searched-for string... the
above will sum up the values in Column B for any cell in Column A that
contains the text "partial match me" either in whole or within a larger text
string containing that text.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
If I understand what you are trying to do, I think the SUMIF function is
what you will want to use. Assuming Column A has your strings to be
searched and Column B has your numbers to be summed (just change the
ranges as required; you can specify a larger range than your current data
set if you will adding new data in the future)...

=SUMIF(A1:A1000,"Some string value",B1:B1000)

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a column
to
locate evey occurence of a string and subsequently sum the corresponding
numbers in a different column



.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default test if a logical statement and use the answer within an if st

That is a completely different problem than you first posted and, of course,
it requires a completely different solution. See if this does what you
want...

=SUMPRODUCT((ISNUMBER(SEARCH("mech",A1:A1000))*((B 1:B1000=1)+(B1:B1000="A"))))

Change the range limits as needed. You can specify a larger range than your
current data set if you will adding new data in the future, but note that
the row limits for each range in the above formula must be the same (that
is, start at the same row number and end with the same row number).

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
Firstly thanks to all who replied, but I have an additional problem.

Column A has the data that I am searching for, and the SUMIF would work
ideally if all the corresponding values in column be were of the same
format,
however column B will contain either 1, A, D or blank and I need also to
add
1 to the total for every occurence of value A.

eg
Column A Column B
Mech Shift 1 1
Inst Shift 1 1
Elec Shift 1 1
Mech Shift 2 A
Mech Shift 3 D

I need a formula that will serch for every occurence of Mech in column A
and
count only the 1's and A's in column B, so in the above case the total
should
be 2.
In case anyone is wondering, A and D stand for arrival and departure.

"Rick Rothstein" wrote:

My previous post gave you the method to SUMIF for an exact match... if
you
need to do a partial match, then just use the asterisk wildcard on either
side of the text you are searching for...

=SUMIF(A1:A1000,"*partial match me*",B1:B1000)

Note the asterisks on either end of the to-be-searched-for string... the
above will sum up the values in Column B for any cell in Column A that
contains the text "partial match me" either in whole or within a larger
text
string containing that text.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
If I understand what you are trying to do, I think the SUMIF function
is
what you will want to use. Assuming Column A has your strings to be
searched and Column B has your numbers to be summed (just change the
ranges as required; you can specify a larger range than your current
data
set if you will adding new data in the future)...

=SUMIF(A1:A1000,"Some string value",B1:B1000)

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a
column
to
locate evey occurence of a string and subsequently sum the
corresponding
numbers in a different column


.


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default test if a logical statement and use the answer within an if st

Thank your Rick, that appears to work just fine.

"Rick Rothstein" wrote:

That is a completely different problem than you first posted and, of course,
it requires a completely different solution. See if this does what you
want...

=SUMPRODUCT((ISNUMBER(SEARCH("mech",A1:A1000))*((B 1:B1000=1)+(B1:B1000="A"))))

Change the range limits as needed. You can specify a larger range than your
current data set if you will adding new data in the future, but note that
the row limits for each range in the above formula must be the same (that
is, start at the same row number and end with the same row number).

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
Firstly thanks to all who replied, but I have an additional problem.

Column A has the data that I am searching for, and the SUMIF would work
ideally if all the corresponding values in column be were of the same
format,
however column B will contain either 1, A, D or blank and I need also to
add
1 to the total for every occurence of value A.

eg
Column A Column B
Mech Shift 1 1
Inst Shift 1 1
Elec Shift 1 1
Mech Shift 2 A
Mech Shift 3 D

I need a formula that will serch for every occurence of Mech in column A
and
count only the 1's and A's in column B, so in the above case the total
should
be 2.
In case anyone is wondering, A and D stand for arrival and departure.

"Rick Rothstein" wrote:

My previous post gave you the method to SUMIF for an exact match... if
you
need to do a partial match, then just use the asterisk wildcard on either
side of the text you are searching for...

=SUMIF(A1:A1000,"*partial match me*",B1:B1000)

Note the asterisks on either end of the to-be-searched-for string... the
above will sum up the values in Column B for any cell in Column A that
contains the text "partial match me" either in whole or within a larger
text
string containing that text.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
If I understand what you are trying to do, I think the SUMIF function
is
what you will want to use. Assuming Column A has your strings to be
searched and Column B has your numbers to be summed (just change the
ranges as required; you can specify a larger range than your current
data
set if you will adding new data in the future)...

=SUMIF(A1:A1000,"Some string value",B1:B1000)

--
Rick (MVP - Excel)


"BG Mark" wrote in message
...
How can I use the Find function within an array formula to check a
column
to
locate evey occurence of a string and subsequently sum the
corresponding
numbers in a different column


.


.

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
IF Logical Test s bruce New Users to Excel 5 February 23rd 09 05:15 PM
If Statement with Two Different Logical Test Storm Excel Worksheet Functions 16 December 15th 08 07:22 PM
Logical test in IF statement returning incorrect result Isabel Excel Worksheet Functions 3 December 13th 07 06:13 PM
If statement where the logical test is a range that equals a word Steve o Excel Worksheet Functions 8 June 27th 05 02:43 PM
Logical test Sooraj Excel Discussion (Misc queries) 2 January 25th 05 12:59 PM


All times are GMT +1. The time now is 03:41 PM.

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"