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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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 14 years, 10 months 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
-
WinRE KB5057589 fake out
by
Susan Bradley
2 hours, 40 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
2 hours, 48 minutes ago -
Firefox 137
by
Charlie
5 hours, 31 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
9 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
9 hours, 12 minutes ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
9 hours, 14 minutes ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
2 hours, 19 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
12 hours, 46 minutes ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
18 hours, 47 minutes ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
1 day, 5 hours ago -
Office apps read-only for family members
by
b
1 day, 7 hours ago -
Defunct domain for Microsoft account
by
CWBillow
1 day, 4 hours ago -
24H2??
by
CWBillow
18 hours, 47 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
13 hours, 1 minute ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
13 hours, 14 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
4 hours, 2 minutes ago -
two pages side by side land scape
by
marc
3 days, 5 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
3 days, 7 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
2 days, 10 hours ago -
Security Essentials or Defender?
by
MalcolmP
2 days, 13 hours ago -
April 2025 updates out
by
Susan Bradley
8 hours, 17 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
2 days, 6 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 day, 20 hours ago -
Creating an Index in Word 365
by
CWBillow
2 days, 23 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
1 day, 11 hours ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
4 days, 2 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
4 days, 6 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
4 days, 7 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
4 days, 5 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
7 hours, 39 minutes 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.