SUMIF Formula with Text

collegeitdept

Board Regular
Joined
Nov 14, 2008
Messages
185
4423508734_a2c53e0787_o.jpg


I have a list a store locations and their inventory of their freezers (how many). Column A lists the store locations, Column B lists their freezers.

I need a formula (I was thinking of using the SUMIF formula...but it doesn't work with text) in cell G1 that sums how many freezer doors for the store in question (cell E1).

EX: Store 126 has 17 total freezers.

HOWEVER: if you look at Store 130 it lists one of their freezers as "Large Full Freezer"... this is equal to 13.

So if the store in question was 130, the formula would add the freezers and it would be "LF - 25" because it has a Large Full freezer.

Thanks.
 
If you want to do that with one formula you might need to switch to an "array formula" like this

=SUM(IF(A2:A28=E1,IF(ISNUMBER(LEFT(B2:B28)+0),LEFT(B2:B28,FIND(" ",B2:B28)-1)+0,IF(B2:B28="Large Full Freezer",13,IF(B2:B28<>"",3)))))

That should add the numbers for those that have them and count 13 for a "Large full freezer" and 3 for any other text (not blanks)

The formula needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
The formula doesn't work


the list goes on until the 2500 row so i changed the formula to:

=SUM(IF(A2:A2500=E1,IF(ISNUMBER(LEFT(B2:B2500)+0),LEFT(B2:B28,FIND(" ",B2:B2500)-1)+0,IF(B2:B2500="Large full freezer",13,IF(B2:B2500<>"",3)))))


it comes up with "#N/A"
 
Upvote 0
You still have one range unchanged - try like this

=SUM(IF(A2:A2500=E1,IF(ISNUMBER(LEFT(B2:B2500)+0),LEFT(B2:B2500,FIND(" ",B2:B2500)-1)+0,IF(B2:B2500="Large full freezer",13,IF(B2:B2500<>"",3)))))
 
Upvote 0
On the cell next to it... how do show a warning if it's a "large full freezer"?

ie: 435 has a large full freezer... so the if formula would return "LF" and if the store number had a special (another text variable ie: reach in, compressor, etc...) the formula would return "CK" to check that store and get proper information.

Thanks.
 
Upvote 0
Try this version

=IF(SUMPRODUCT((A2:A2500=E1)*(B2:B2500="Large full freezer")),"LF",IF(SUMPRODUCT((A2:A2500=E1)*(ISERR(LEFT(B2:B2500)+0))),"CK",""))
 
Upvote 0

Forum statistics

Threads
1,215,948
Messages
6,127,871
Members
449,410
Latest member
adunn_23

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
Back
Top