Query formula (one field based on another field)

afs24

Board Regular
Joined
Sep 26, 2002
Messages
237
I have two fields VCP & SSP. I want to pull all VCP's less than 12 and all SSP's that are 50% of the VCP or less. How would I create this in a query.

VCP SSP
12 6
12 4
10 5
10 2
6 6
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
In the criteria for the VCP field add <12.
add a new column and add PC: [ssp]/[vcp] to caculate the PerCentage.
In the criteria of this column add <0.5

If you want it to select both cases put the criteria on seperate Rows. (I.E if you want a VCP of 14 and a SSP of 5 to show)


HTH

Peter
 
Upvote 0
Here is the SQL for a query:

SELECT Table1.VCP, Table1.SSP
FROM Table1
WHERE (((Table1.VCP)<12) AND ((Table1.SSP)<=(VCP * .5) ));

This returns records of VCP 10 & 10 with the SSP records with 5 & 2

I think this is what ya wanted.

Dave,,
 
Upvote 0

Forum statistics

Threads
1,221,553
Messages
6,160,468
Members
451,649
Latest member
fahad_ibnfurjan

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