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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,215,372
Messages
6,124,535
Members
449,169
Latest member
mm424

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