IIF and InStr

MonsterCR7

New Member
Joined
Jun 27, 2013
Messages
29
Hi All,
I am in query mode and I am trying to create a new column that will show an IIF statement to find certain words in the item number to return a result.
For example, If the item number contains the words “SER” then multiply the quantity times 20 to give a result of the cost of the labor hours.
The expression itself is working correctly, but it will only allow me to count values or records for the field.
How do I get it so that I can do a sum of the total cost of the labor hours?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
It should work. Can you post your SQL text?

Also, for what its worth, an easy solution that I also will implement is to:
  1. write the query with the IIF statement in it (don't use any aggregate functions here)
  2. write a query on the query you just wrote - this is where you sum up values using SUM().
 
Upvote 0
SUM rather than COUNT
Note that there are a variety of Aggregate Functions to choose from. COUNT is just one of them. SUM is another option (as well as others).
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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