473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Converting A If Formula In MS Excel To A MS Access Command/Query

Excel Formula:
Expand|Select|Wrap|Line Numbers
  1. =IF(U6<2,Z6*1,IF(U6<5,Z6*1.5,IF(U6<11,Z6*2,IF(U6<21,Z6*3,IF(U6<100000,Z6*5)))))
  2.  
  3. =IF(V5<2,AA5*0.8,IF(V5<5,AA5*1,IF(V5<11,AA5*1.5,IF(V5<21,AA5*2,IF(V5<100000,AA5*3)))))
  4.  
  5. =IF(W5<2,AB5*0.5,IF(W5<5,AB5*0.8,IF(W5<11,AB5*1,IF(W5<21,AB5*1.5,IF(W5<100000,AB5*2)))))
  6.  
  7. =IF(X5<2,AC5*0.3,IF(X5<5,AC5*0.5,IF(X5<11,AC5*0.8,IF(X5<21,AC5*1,IF(X5<100000,AC5*1.5)))))
  8.  
  9. =IF(Y5<2,AD5*1,IF(Y5<5,AD5*1,IF(Y5<11,AD5*1,IF(Y5<21,AD5*1,IF(Y5<100000,AD5*1)))))

P.S- I tried converting these formulas as separate IIF functions in Access and it worked.

But as I want it all together as a single field but it is showing up as "it is a too complex function for MS Access to process" .Please do help me out regarding this.
Mar 13 '15 #1
1 1175
Seth Schrock
2,965 Expert 2GB
Try the Switch() function. This behaves like a Select Case statement. In combination with the Between function, I think that it would be much easier to understand what is happening. The following example still uses the cell references, so those would need to be changed to the appropriate field or control references.
Expand|Select|Wrap|Line Numbers
  1. =Switch(U6 Between 0 and 1, Z6 * 1
  2. , U6 Between 2 And 4, Z6 * 1.5
  3. , U6 Between 5 And 10, Z6 * 2
  4. , U6 Between 11 And 20, Z6 * 3
  5. , U6 Between 21 And 100000, Z6 * 5)
The other, more manageable approach would be to create a table that has three fields: LowRange, HighRange, Factor. This allows for you to easily change the ranges and the factors. Then you can just find the record that your values fits into and get that range.
Mar 19 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jack | last post by:
Hi, I am working on a asp page where I am opening a recordset object using an Access stored query named "GMISExpenseCombo". I have to use this resultset with various fields in the page. Howeve,r...
2
by: ILCSP | last post by:
Hello, I have the following query in Access 2000 that I need to convert to SQL 2000: UPDATE tblShoes, tblBoxes SET tblShoes.Laces1 = Null WHERE (((tblShoes.ShoesID)=Int(.)) AND...
5
by: nedian | last post by:
Hello I am student and trying to learn access.I am having problem in making a program can any one help me? i wanted to make 2 tables in access and then create a link.First i am telling u what...
1
by: viral123 | last post by:
Hi all I am using Crystal report and I am running my report successfully for my query but I want to make my query for one specific date. I want to get the date value from the textbox value. ...
6
by: bobh | last post by:
Hi All, I'm looking for help with what the Transact SQL code is for this Access Update query sql code. I've been doing Access for some time and all my back-ends have been jet. I'm just starting...
3
by: skiddle | last post by:
I've got an Excel formula that calculates the total business hours that a help desk ticket is open. As one would expect, it factors out holidays and non-work hours. What would be the corresponding...
1
by: DE529 | last post by:
Is there a way to override a formula in Access 2003? 90% of the time the formula fits with what I am needing, however there are times when I need to put in a different amount than what the formula...
2
by: welshkaiboy | last post by:
Due to the size of the data I have to manipulate I need to apply a excel formula in access which determines date of manufacture from a serial number 716001 so I use...
1
by: baburmm | last post by:
Hi all, Can any one tell me, Export datas to a Excel file using query without openrowset method is there any other methods are posible for creating an Excel file to export it Thanks,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.