I want to use an IIF statement in my access query, but Excel will not allow me to import the query data because it doesn’t recognize an IIF. Can you suggest an alternative? 2003, BTW.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
IIF stmt does not allow query from Excel
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » IIF stmt does not allow query from Excel
- This topic has 10 replies, 4 voices, and was last updated 15 years ago.
AuthorTopicWScchambers@work
AskWoody LoungerMay 24, 2010 at 1:46 pm #469099Viewing 9 reply threadsAuthorReplies-
WBell
AskWoody_MVPMay 24, 2010 at 2:17 pm #1225396I’m not sure how you are trying to import the query data into Excel, but if you export it to Excel from Access it should work just fine. Simply right-click on your saved query, and choose Export and specify an Excel file time and it should get you what you are after. And the IIF statment won’t show up in your data – I do this regularly.
-
WScchambers@work
AskWoody Lounger -
WSjeremybarker
AskWoody Lounger -
WScchambers@work
AskWoody LoungerMay 25, 2010 at 11:26 am #1225524Aaaahhhhhhhaaaaaa!!!!!
Thank you for catching that. I was so fixed on the IIF statement that I didn’t cross validate my remaining formulas. I found that it was linked to these 2:
GRP_TRIM: Trim(StrReverse([Full Name]))
GRP: StrReverse(Trim(Left([GRP_TRIM],InStr([GRP_TRIM],” “)-1)))
I’m doing that because i have a field in [Full Name] where we have manipulated the data. we had nowhere else to put a “type” so we jury-rigged the name field to show it. any idea what to do here to give me a field that will reflect the type(grp) shown at the end of the name? thanks!!!!
John S. Doe VENDOR
John S. Doe CLIENT
John S. Doe EMPLOYEE
John S. Doe 12/31/2011 -
WScchambers@work
AskWoody Lounger -
WSkentg
AskWoody LoungerMay 26, 2010 at 1:01 am #1225577What is the StrReverse function trying to do? It’s not a built in function.
Can you give an example of the contents of the field and what you want it to look like in the output.
You may be able to get what you want using InStrRev([GRP_TRIM],” “) to get the position of the last space and then use Mid() to reassemple the bits you want.
if your [Full Name] is “John S. Doe VENDOR”
Mid([Full Name], InStrRev([Full Name], ” “) + 1)
will result in “VENDOR”
-
WBell
AskWoody_MVPMay 26, 2010 at 9:22 am #1225606StrReverse actually gives you the string backwards – see StrReverse Function – Access …. I think the approach you suggest should work.
-
WScchambers@work
AskWoody LoungerMay 26, 2010 at 11:22 am #1225616StrReverse and StrRev are my actual problem. those expressions aren’t recognized when i’m in excel pull in my data from access. I basically need create fields that would reflect the following for the [FULL NAME] fields shown below. The problem is that this is a free-form text field we are manipulating. I was trying to do a string reverse and take into account any typos or spaces that i know the team will mess up during setup. by doing a reverse, i thought if i put the “type” information first, i could possibly jury-rig it futher to take into account fat-fingering the data. since StrReverse doesn’t play well with excel, is there any other suggestions that you might have?
the formula previously suggested: Mid([Full Name], InStrRev([Full Name], ” “) + 1) returned blanks. it’s right on the tip of the brain, but i just can’t get over the hump. thanks!
VENDOR
CLIENT
EMPLOYEE
12/31/2011John S. Doe VENDOR
John S. Doe CLIENT
John S. Doe EMPLOYEE
John S. Doe 12/31/2011 -
WBell
AskWoody_MVPMay 26, 2010 at 12:51 pm #1225623I think I see the issue – the Mid as Kent typed it only has the starting character, and doesn’t tell you how many to get, so it returns blanks. The function should look like
Mid([Full Name], InStrRev([Full Name], ” “) + 1,25)
The 25 is just a stab at what the maximum length the string following the name might be. You could get cute and calculate it using the Len() and a second InStrRev() function, but the mid will take whatever length you put in there and return only the number of characters that exist. -
WScchambers@work
AskWoody LoungerMay 27, 2010 at 2:49 pm #1225936The problem is that StrReverse, StrRev, and InStrRev do not translate to Excel. So when I have those expressions in my query, excel doesn’t know how to read them. It fails in getting the data out. hhhhhmmmm. i’m really stumped on this one. i think i might just have to leave it without pulling out those fields and deliver it down to excel that way. then, within excel, i’ll write formulas there to pull out the “type” …..that is, unless someone else can think of anything. thanks all for trying!!!!
Viewing 9 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
KB5058379 / KB 5061768 Failures
by
crown
37 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
3 hours, 16 minutes ago -
At last – installation of 24H2
by
Botswana12
4 hours, 1 minute ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
38 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
16 hours, 13 minutes ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
9 hours, 32 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
1 day, 5 hours ago -
Another test post
by
gtd12345
1 day, 5 hours ago -
Connect to someone else computer
by
wadeer
1 day ago -
Limit on User names?
by
CWBillow
1 day, 3 hours ago -
Choose the right apps for traveling
by
Peter Deegan
17 hours, 12 minutes ago -
BitLocker rears its head
by
Susan Bradley
1 hour, 13 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
10 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
19 hours, 35 minutes ago -
A smarter, simpler Firefox address bar
by
Alex5723
1 day, 16 hours ago -
Woody
by
Scott
2 days, 1 hour ago -
24H2 has suppressed my favoured spider
by
Davidhs
50 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
2 days, 15 hours ago -
MS Office 365 Home on MAC
by
MickIver
2 days, 9 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
3 days, 5 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
34 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
3 days, 4 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
3 days, 5 hours ago -
Login screen icon
by
CWBillow
2 days, 19 hours ago -
AI coming to everything
by
Susan Bradley
10 hours, 3 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
4 days, 16 hours ago -
No Screen TurnOff???
by
CWBillow
4 days, 16 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
4 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.