Making IF-sentence with empty cells with spaces

Spec

New Member
Joined
Aug 1, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi,

Thank you for the forum! I am working on a ExCel-raport where we retrive the data via a query.

Now I want to have a formula telling me (here I have used "It works) if all the necessary cells has values.

I thought I fixed it by using:
=IF(AND(D1<>"";E1<>"";F1<>"";G1<>"";H1<>"");"It works";"")
however, some of the cells being downloaded to the ExCel-sheet is empty, but contains spaces. How do I then know that the necessary cells contains values (some contains letters, some numbers), but not spaces?

The meaning by the report is that is should be automated, so I can't go in and mark the cells and delete the spaces everytime it retrives data with the query

If anyone has a good solution, please yell out :)

Thanks!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Maybe...

=IF(TRIM(D1&E1&F1&G1&H1)="","It works","")
 
Upvote 0
Hi,
I need all necessary cells to contain a number or text before it is valid.

F.ex
D1,E1,F1,G1,H1 all needs to contain number or text to be valid. If any of those cells does not contain a value or spaces, the cell with the formula should be blank ("")
1659370585212.png
 
Upvote 0
I might have solved it myself :O

=IF(AND(TRIM(D1)<>"";TRIM(E1)<>"";TRIM(F1)<>"";TRIM(G1)<>"";TRIM(H1)<>"");"It works";"")
 
Upvote 0
Then maybe:

=IF(SUMPRODUCT(--(LEN(D1:H1)>0),--(TRIM(D1:H1)<>""))<5,"","It works")
 
Upvote 0
Solution

Forum statistics

Threads
1,223,713
Messages
6,174,038
Members
452,542
Latest member
Bricklin

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